From 1f10a3fc8240fe28a95dcd61ae63f2e7ced276c7 Mon Sep 17 00:00:00 2001 From: Nikolas Burk Date: Tue, 5 Nov 2024 16:03:14 +0100 Subject: [PATCH] update ts-node to tsx --- content/100-getting-started/01-quickstart-sqlite.mdx | 10 +++++----- ...0-relational-databases-typescript-cockroachdb.mdx | 2 +- .../110-relational-databases-typescript-mysql.mdx | 2 +- ...0-relational-databases-typescript-planetscale.mdx | 2 +- ...10-relational-databases-typescript-postgresql.mdx | 2 +- ...elational-databases-typescript-prismaPostgres.mdx | 2 +- ...110-relational-databases-typescript-sqlserver.mdx | 2 +- ...-querying-the-database-typescript-cockroachdb.mdx | 6 +++--- .../250-querying-the-database-typescript-mysql.mdx | 6 +++--- ...-querying-the-database-typescript-planetscale.mdx | 6 +++--- ...0-querying-the-database-typescript-postgresql.mdx | 6 +++--- ...erying-the-database-typescript-prismaPostgres.mdx | 10 +++++----- ...50-querying-the-database-typescript-sqlserver.mdx | 6 +++--- .../120-mongodb-typescript-mongodb.mdx | 2 +- .../250-querying-the-database-typescript-mongodb.mdx | 6 +++--- ...-querying-the-database-typescript-cockroachdb.mdx | 12 ++++++------ .../250-querying-the-database-typescript-mysql.mdx | 12 ++++++------ ...-querying-the-database-typescript-planetscale.mdx | 12 ++++++------ ...0-querying-the-database-typescript-postgresql.mdx | 12 ++++++------ ...50-querying-the-database-typescript-sqlserver.mdx | 12 ++++++------ .../250-querying-the-database-typescript-mongodb.mdx | 6 +++--- .../300-workflows/45-data-migration.mdx | 4 ++-- 22 files changed, 70 insertions(+), 70 deletions(-) diff --git a/content/100-getting-started/01-quickstart-sqlite.mdx b/content/100-getting-started/01-quickstart-sqlite.mdx index a7be964a7a..c6f63617e9 100644 --- a/content/100-getting-started/01-quickstart-sqlite.mdx +++ b/content/100-getting-started/01-quickstart-sqlite.mdx @@ -33,7 +33,7 @@ Next, initialize a TypeScript project using npm: ```terminal npm init -y -npm install typescript ts-node @types/node --save-dev +npm install typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. @@ -184,7 +184,7 @@ Next, execute the script with the following command: ```terminal -npx ts-node script.ts +npx tsx script.ts ``` @@ -238,7 +238,7 @@ Execute the script again: ```terminal -npx ts-node script.ts +npx tsx script.ts ``` @@ -308,7 +308,7 @@ Run the query by executing the script again: ```terminal -npx ts-node script.ts +npx tsx script.ts ``` @@ -361,7 +361,7 @@ Run the script again to see the results of the nested read query: ```terminal -npx ts-node script.ts +npx tsx script.ts ``` diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-cockroachdb.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-cockroachdb.mdx index 4522b28308..2ee6b05f1b 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-cockroachdb.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-cockroachdb.mdx @@ -41,7 +41,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-mysql.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-mysql.mdx index 7f1b1cdd85..2e0b89564d 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-mysql.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-mysql.mdx @@ -41,7 +41,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-planetscale.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-planetscale.mdx index f0213f7ec9..4930b60d58 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-planetscale.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-planetscale.mdx @@ -47,7 +47,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-postgresql.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-postgresql.mdx index 463054d4d8..139ff6a2aa 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-postgresql.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-postgresql.mdx @@ -36,7 +36,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-prismaPostgres.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-prismaPostgres.mdx index 00428980bb..97c2cfb5eb 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-prismaPostgres.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-prismaPostgres.mdx @@ -40,7 +40,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdx index 2a24329027..eb49241bcb 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdx @@ -43,7 +43,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx index 20485f8987..f1409fcfdb 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx @@ -60,7 +60,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -109,7 +109,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -193,7 +193,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-mysql.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-mysql.mdx index 5d9b0d7c5f..bb149dafc0 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-mysql.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-mysql.mdx @@ -60,7 +60,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -109,7 +109,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -193,7 +193,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx index eaac334d6e..49de89bc0a 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx @@ -60,7 +60,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -109,7 +109,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -193,7 +193,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx index 3d0cf09604..a4abfc649c 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx @@ -59,7 +59,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -108,7 +108,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -192,7 +192,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-prismaPostgres.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-prismaPostgres.mdx index c15c5a448b..b5211d77f7 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-prismaPostgres.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-prismaPostgres.mdx @@ -66,7 +66,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node queries.ts +npx tsx queries.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -119,7 +119,7 @@ Notice that you're also passing the [`include`](/orm/prisma-client/queries/selec Run the code with this command: ```terminal copy -npx ts-node queries.ts +npx tsx queries.ts ``` The output should look similar to this: @@ -216,7 +216,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node queries.ts +npx tsx queries.ts ``` You will see the following output: @@ -309,7 +309,7 @@ There's a bunch of things happening here, let's take a closer look: Start the script with the following command: ```terminal -npx ts-node realtime.ts +npx tsx realtime.ts ``` You should see the following output: @@ -361,7 +361,7 @@ async function main() { Then you can run the script using the command from before (in a new terminal tab or window): ```terminal -npx ts-node queries.ts +npx tsx queries.ts ``` You should now see output similar to this in previous terminal tab/window: diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx index 68e580711f..f7334efa85 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx @@ -60,7 +60,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -109,7 +109,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -193,7 +193,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx index b4b9d91a47..44930d5773 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx @@ -46,7 +46,7 @@ Next, initialize a TypeScript project and add the Prisma CLI as a development de ```terminal copy npm init -y -npm install prisma typescript ts-node @types/node --save-dev +npm install prisma typescript tsx @types/node --save-dev ``` This creates a `package.json` with an initial setup for your TypeScript app. diff --git a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/250-querying-the-database-typescript-mongodb.mdx b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/250-querying-the-database-typescript-mongodb.mdx index 9dd956739e..9711da8a1d 100644 --- a/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/250-querying-the-database-typescript-mongodb.mdx +++ b/content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb/250-querying-the-database-typescript-mongodb.mdx @@ -59,7 +59,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` This should print an empty array because there are no `User` records in the database yet: @@ -108,7 +108,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -197,7 +197,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx index e50d622b5d..7dad3c78c2 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx @@ -63,10 +63,10 @@ async function main() { } ``` -Now run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Now run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` If you created a database using the schema from the database introspection step, the query should print an empty array because there are no `User` records in the database yet. @@ -112,10 +112,10 @@ This code creates a new `User` record together with new `Post` and `Profile` rec Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields) option to `findMany` which tells Prisma Client to include the `posts` and `profile` relations on the returned `User` objects. -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` Before moving on to the next section, you'll "publish" the `Post` record you just created using an `update` query. Adjust the `main` function as follows: @@ -130,9 +130,9 @@ async function main() { } ``` -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx index d6419d7913..d502f42b8e 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx @@ -63,10 +63,10 @@ async function main() { } ``` -Now run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Now run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` If you created a database using the schema from the database introspection step, the query should print an empty array because there are no `User` records in the database yet. @@ -112,10 +112,10 @@ This code creates a new `User` record together with new `Post` and `Profile` rec Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields) option to `findMany` which tells Prisma Client to include the `posts` and `profile` relations on the returned `User` objects. -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` Before moving on to the next section, you'll "publish" the `Post` record you just created using an `update` query. Adjust the `main` function as follows: @@ -130,8 +130,8 @@ async function main() { } ``` -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx index 04d3218d1f..5cd1c6457e 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx @@ -63,10 +63,10 @@ async function main() { } ``` -Now run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Now run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` @@ -113,10 +113,10 @@ This code creates a new `User` record together with new `Post` and `Profile` rec Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields) option to `findMany` which tells Prisma Client to include the `posts` and `profile` relations on the returned `User` objects. -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` Before moving on to the next section, you'll "publish" the `Post` record you just created using an `update` query. Adjust the `main` function as follows: @@ -131,8 +131,8 @@ async function main() { } ``` -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx index c36952c37c..3cc4f5d375 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx @@ -62,10 +62,10 @@ async function main() { } ``` -Now run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Now run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` If you created a database using the schema from the database introspection step, the query should print an empty array because there are no `User` records in the database yet. @@ -111,10 +111,10 @@ This code creates a new `User` record together with new `Post` and `Profile` rec Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields) option to `findMany` which tells Prisma Client to include the `posts` and `profile` relations on the returned `User` objects. -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` Before moving on to the next section, you'll "publish" the `Post` record you just created using an `update` query. Adjust the `main` function as follows: @@ -129,8 +129,8 @@ async function main() { } ``` -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx index 4ee4870c16..57ca650fb8 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx @@ -63,10 +63,10 @@ async function main() { } ``` -Now run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Now run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` If you created a database using the schema from the database introspection step, the query should print an empty array because there are no `User` records in the database yet. @@ -112,10 +112,10 @@ This code creates a new `User` record together with new `Post` and `Profile` rec Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fields#include-relations-and-select-relation-fields) option to `findMany` which tells Prisma Client to include the `posts` and `profile` relations on the returned `User` objects. -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` Before moving on to the next section, you'll "publish" the `Post` record you just created using an `update` query. Adjust the `main` function as follows: @@ -130,8 +130,8 @@ async function main() { } ``` -Run the code with your current TypeScript setup. If you're using `ts-node`, you can run it like this: +Run the code with your current TypeScript setup. If you're using `tsx`, you can run it like this: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx index bd992de8e0..3bb06a22ff 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx @@ -64,7 +64,7 @@ async function main() { Now run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` If you introspected an existing database with records, the query should return an array of JavaScript objects. @@ -107,7 +107,7 @@ Notice that you're passing the [`include`](/orm/prisma-client/queries/select-fie Run the code with this command: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` The output should look similar to this: @@ -201,7 +201,7 @@ async function main() { Now run the code using the same command as before: ```terminal copy -npx ts-node index.ts +npx tsx index.ts ``` You will see the following output: diff --git a/content/200-orm/300-prisma-migrate/300-workflows/45-data-migration.mdx b/content/200-orm/300-prisma-migrate/300-workflows/45-data-migration.mdx index bd852bc07f..eb471f0114 100644 --- a/content/200-orm/300-prisma-migrate/300-workflows/45-data-migration.mdx +++ b/content/200-orm/300-prisma-migrate/300-workflows/45-data-migration.mdx @@ -189,8 +189,8 @@ Update the `package.json` file with the script to execute the data-migration fil ```json file=package.json "scripts": { - "dev": "ts-node ./script.ts", - "data-migration:add-status-column": "ts-node ./prisma/migrations/20230417131956_add-status-column/data-migration.ts" + "dev": "tsx ./script.ts", + "data-migration:add-status-column": "tsx ./prisma/migrations/20230417131956_add-status-column/data-migration.ts" }, ```