How can I use a different database driver (e.g. libsql for Turso) #4299
Unanswered
caramellok
asked this question in
Help
Replies: 1 comment
-
Hi! For those looking for how to connect to the TURSO database using AdonisJS (^6), here are the steps to configure it:
Additionally, make sure to install the
// database.ts
const dbConfig = defineConfig({
connection: 'sqlite',
connections: {
sqlite: {
client: 'libsql',
connection: {
filename: 'https://{database}-{username}.turso.io?authToken={authToken}', // e.g.: https://mydb-myusername.aws-eu-west-3.turso.io?authToken=12345
},
useNullAsDefault: true,
migrations: {
naturalSort: true,
paths: ['database/migrations'],
},
},
},
}) Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I know that Lucid uses Knex, and one can use the libsql wrapper with Knex like so, but I can't for the life of me figure out how I'd do this in AdonisJS.
Have any AdonisJS users successfully deployed their databases to Turso?
Beta Was this translation helpful? Give feedback.
All reactions