docker
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}[fragile]{Példa séma}
|
||||
\begin{block}{schema.prisma}
|
||||
\begin{block}{schema.prisma - Product}
|
||||
\begin{lstlisting}[language=JavaScript]
|
||||
model Product {
|
||||
id Int @id @default(autoincrement())
|
||||
@@ -30,6 +30,13 @@ model Product {
|
||||
references: [id])
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
\end{lstlisting}
|
||||
\end{block}
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}[fragile]{Példa séma (folyt.)}
|
||||
\begin{block}{schema.prisma - Category}
|
||||
\begin{lstlisting}[language=JavaScript]
|
||||
model Category {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
@@ -47,7 +54,13 @@ async function countProducts() {
|
||||
const count = await prisma.product.count();
|
||||
console.log(`Összes termék: ${count}`);
|
||||
}
|
||||
// Szűrt számlálás
|
||||
\end{lstlisting}
|
||||
\end{block}
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}[fragile]{Count - Számlálás (szűréssel)}
|
||||
\begin{block}{Szűrt számlálás}
|
||||
\begin{lstlisting}[language=JavaScript]
|
||||
async function countExpensiveProducts() {
|
||||
const count = await prisma.product.count({
|
||||
where: {
|
||||
@@ -69,14 +82,17 @@ async function getProductStats() {
|
||||
const stats = await prisma.product.aggregate({
|
||||
_count: true,
|
||||
_avg: {price: true},
|
||||
|
||||
_sum: {stock: true},
|
||||
|
||||
_min: {price: true},
|
||||
|
||||
_max: {price: true}
|
||||
});
|
||||
|
||||
\end{lstlisting}
|
||||
\end{block}
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}[fragile]{Aggregate - Alapok (folyt.)}
|
||||
\begin{block}{Egyszerű aggregáció}
|
||||
\begin{lstlisting}[language=JavaScript]
|
||||
console.log(stats);
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
Reference in New Issue
Block a user