File tree Expand file tree Collapse file tree 6 files changed +297
-27
lines changed
content/docs/1.getting-started Expand file tree Collapse file tree 6 files changed +297
-27
lines changed Original file line number Diff line number Diff line change @@ -49,23 +49,54 @@ export default defineNuxtConfig({
4949})
5050```
5151
52-
5352### ` Postgres `
5453
55- If you plan to deploy your application using PostgreSql database you need to use ` postgres ` database adapter.
54+ If you plan to deploy your application using PostgreSql database you need to use ` postgres ` database adapter.
55+
56+ First, make sure to install the ` pg ` package:
57+
58+ ``` bash [Terminal]
59+ npx nypm i pg
60+ ```
61+
62+ Then, configure the ` postgres ` adapter in your ` nuxt.config.ts ` :
5663
5764``` ts [nuxt.config.ts]
5865export default defineNuxtConfig ({
5966 content: {
6067 database: {
6168 type: ' postgres' ,
62- url: ' POSTGRES_URL' ,
69+ url: process . env . POSTGRES_URL ,
6370 /* Other options for `pg` */
6471 }
6572 }
6673})
6774```
6875
76+ ### ` LibSQL ` / ` Turso `
77+
78+ If you plan to deploy your application using LibSQL/Turso database you need to use ` libsql ` database adapter.
79+
80+ First, make sure to install the ` @libsql/client ` package:
81+
82+ ``` bash [Terminal]
83+ npx nypm i @libsql/client
84+ ```
85+
86+ Then, configure the ` libsql ` adapter in your ` nuxt.config.ts ` :
87+
88+ ``` ts [nuxt.config.ts]
89+ export default defineNuxtConfig ({
90+ content: {
91+ database: {
92+ type: ' libsql' ,
93+ url: process .env .TURSO_DATABASE_URL ,
94+ authToken: process .env .TURSO_AUTH_TOKEN ,
95+ }
96+ }
97+ })
98+ ```
99+
69100## ` build `
70101
71102Nuxt Content read and parse all the available contents at built time. This option let you control over parsing contents.
Original file line number Diff line number Diff line change @@ -28,8 +28,11 @@ export default defineNuxtConfig({
2828
2929 content : {
3030 database : {
31- type : 'd1' ,
32- binding : 'DB' ,
31+ // type: 'd1',
32+ // binding: 'DB',
33+ type : 'libsql' ,
34+ url : process . env . TURSO_DATABASE_URL ! ,
35+ authToken : process . env . TURSO_AUTH_TOKEN ! ,
3336 } ,
3437 } ,
3538
Original file line number Diff line number Diff line change 7878 "zod-to-ts" : " ^1.2.0"
7979 },
8080 "peerDependencies" : {
81- "pg" : " *"
81+ "pg" : " *" ,
82+ "@libsql/client" : " *"
8283 },
8384 "devDependencies" : {
8485 "@cloudflare/workers-types" : " ^4.20241106.0" ,
You can’t perform that action at this time.
0 commit comments