Post by account_disabled on Feb 24, 2024 22:38:00 GMT -5
Import createClient from libsqlclient Create a new instance of the libSQL database client const libsql create Client tsexpe cterror url process.env.TURSOD ATABASEURL authToken process.env.TURSOAU THTOKEN Create a Prisma adapter for libSQL const adapter new PrismaLibSQLlibsql Pass the adapter option to the Prisma Client instance const prisma new PrismaClient adapter export default prisma Get started with Prisma and Turso To start using Turso in your project you must first enable the driverAdapters Preview feature flag. This will allow you to query your database using Tursos driver adapter. The driverA dapters feature flag is part of the driver adapter initiative were working on to enable you use other database drivers to connect to your database.
Example driver adapters include PlanetScale Neon and libSQL. Well share more details soon If you have not yet fill out this survey and leave us your email address for updates. Prerequisites You will need to have the following tools installed Node.js version Switzerland Mobile Number List or later Turso CLI You can set up a project using tryprisma if you dont have an existing project using SQLite. Navigate to your working directory and copy the command below to set up the project npx tryprismalatest template typescriptscript path . name tursoprisma install npm COPY Navigate to the project and open it on your preferred code editor cd tursoprisma COPY Create a database on Turso First.
The create a database on Turso that your application will use. the credentials required to configure Tursos database client. To create a database run the following command on your terminal turso db create tursoprisma COPY Turso will also create a database in the region closest to your location. Create an authentication token that will allow you to connect to the database turso db tokens create turso prisma COPY Next reveal the connection string details to connect to your database turso db show tursoprisma COPY Take note of the authentication token and connection string which will be used to connect to your database in the next step.
Example driver adapters include PlanetScale Neon and libSQL. Well share more details soon If you have not yet fill out this survey and leave us your email address for updates. Prerequisites You will need to have the following tools installed Node.js version Switzerland Mobile Number List or later Turso CLI You can set up a project using tryprisma if you dont have an existing project using SQLite. Navigate to your working directory and copy the command below to set up the project npx tryprismalatest template typescriptscript path . name tursoprisma install npm COPY Navigate to the project and open it on your preferred code editor cd tursoprisma COPY Create a database on Turso First.
The create a database on Turso that your application will use. the credentials required to configure Tursos database client. To create a database run the following command on your terminal turso db create tursoprisma COPY Turso will also create a database in the region closest to your location. Create an authentication token that will allow you to connect to the database turso db tokens create turso prisma COPY Next reveal the connection string details to connect to your database turso db show tursoprisma COPY Take note of the authentication token and connection string which will be used to connect to your database in the next step.