
Prerequisites
Before you start, make sure you:Retrieve database credentials
Get the database URL:Get the database authentication token:Assign credentials to the environment variables inside
.env.Configure Drizzle Kit
Create the file
drizzle.config.ts in the root of your project with the following:drizzle.config.ts
We’re using
dotenv above, but if you’re using something like Next.js, Remix, Astro, or Vite, you can use their built-in environment variables manager to source these values.Database migrations
Drizzle can generate and apply database migrations with Now apply these changes to the database with
drizzle-kit.Whenever you make changes to the schema, run db:generate:db:migrate:Vector Embeddings
You can extend Drizzle to support Turso’s native vector — learn more.Create a table with a vector column
Now where you define the schema, invoke
float32Array to create a column that stores vectors: