-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from ixartz/turso-drizzle
Add Turso and Drizzle ORM
- Loading branch information
Showing
30 changed files
with
8,004 additions
and
4,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Configure environment variables | ||
|
||
# Database | ||
# Please use a working DATABASE_URL. Otherwise, Next.js build will timeout and you will get the following error: "because it took more than 60 seconds" | ||
# DATABASE_URL=libsql://[RANDOM-CHARS]-[DB-NAME]-[ORG-NAME].turso.io | ||
DATABASE_URL=file:next-js-boilerplate.db | ||
|
||
# Clerk authentication | ||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_bGlnaHQtbGFicmFkb3ItNTEuY2xlcmsuYWNjb3VudHMuZGV2JA | ||
CLERK_SECRET_KEY=your_clerk_secret_key | ||
|
||
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in | ||
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up | ||
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard | ||
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ | |
/.pnp | ||
.pnp.js | ||
|
||
# Database | ||
*.db | ||
|
||
# testing | ||
/coverage | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable-next-line import/no-extraneous-dependencies */ | ||
import dotenv from 'dotenv'; | ||
import type { Config } from 'drizzle-kit'; | ||
|
||
dotenv.config({ | ||
path: '.env', | ||
}); | ||
|
||
export default { | ||
out: './migrations', | ||
schema: './src/models/schema.ts', | ||
driver: 'libsql', | ||
dbCredentials: { | ||
url: process.env.DATABASE_URL ?? '', | ||
}, | ||
} satisfies Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Optional: configure or set up a testing framework before each test. | ||
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js` | ||
import '@testing-library/jest-dom/extend-expect'; | ||
import '@testing-library/jest-dom'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE `guestbook` ( | ||
`id` integer PRIMARY KEY NOT NULL, | ||
`username` text NOT NULL, | ||
`body` text NOT NULL, | ||
`created_at` integer DEFAULT (strftime('%s', 'now')), | ||
`updated_at` integer DEFAULT (strftime('%s', 'now')) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"id": "33ba2aeb-9902-4f71-9e40-f18012cd5d31", | ||
"prevId": "00000000-0000-0000-0000-000000000000", | ||
"tables": { | ||
"guestbook": { | ||
"name": "guestbook", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "integer", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"username": { | ||
"name": "username", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"body": { | ||
"name": "body", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false, | ||
"default": "(strftime('%s', 'now'))" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false, | ||
"default": "(strftime('%s', 'now'))" | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"entries": [ | ||
{ | ||
"idx": 0, | ||
"version": "5", | ||
"when": 1692483682335, | ||
"tag": "0000_sharp_marten_broadcloak", | ||
"breakpoints": true | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable import/no-extraneous-dependencies, import/extensions */ | ||
import './src/libs/Env.mjs'; | ||
import withBundleAnalyzer from '@next/bundle-analyzer'; | ||
|
||
const bundleAnalyzer = withBundleAnalyzer({ | ||
enabled: process.env.ANALYZE === 'true', | ||
}); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
export default bundleAnalyzer({ | ||
eslint: { | ||
dirs: ['.'], | ||
}, | ||
poweredByHeader: false, | ||
basePath: '', | ||
// The starter code load resources from `public` folder with `router.basePath` in React components. | ||
// So, the source code is "basePath-ready". | ||
// You can remove `basePath` if you don't need it. | ||
reactStrictMode: true, | ||
webpack: (config) => { | ||
// config.externals is needed to resolve the following errors: | ||
// Module not found: Can't resolve 'bufferutil' | ||
// Module not found: Can't resolve 'utf-8-validate' | ||
config.externals.push({ | ||
bufferutil: 'bufferutil', | ||
'utf-8-validate': 'utf-8-validate', | ||
}); | ||
|
||
return config; | ||
}, | ||
}); |
Oops, something went wrong.