-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
534 additions
and
1,959 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
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,8 +1,3 @@ | ||
module.exports = { | ||
"**/*.[tj]s?(x)": ["eslint --fix --max-warnings=0", "prettier --check"], | ||
"migrations/*.[tj]s": [ | ||
"npm run start:migrate", | ||
"npm run generate:db-types", | ||
"git add app/db.d.ts", | ||
], | ||
}; |
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 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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import SQLite from "better-sqlite3"; | ||
import { Kysely, SqliteDialect } from "kysely"; | ||
import type { DB } from "./db"; | ||
import { databaseUrl } from "./helpers/env"; | ||
|
||
import knex from "knex"; | ||
import knexfile from "~/../knexfile"; | ||
export { SqliteError } from "better-sqlite3"; | ||
|
||
export const dialect = new SqliteDialect({ | ||
database: new SQLite(databaseUrl), | ||
}); | ||
|
||
const db = new Kysely<DB>({ | ||
dialect, | ||
}); | ||
|
||
export default db; | ||
export type { DB }; | ||
const environment = process.env.NODE_ENV || ("development" as const); | ||
// @ts-nocheck | ||
const config: { | ||
client: string; | ||
connection: { | ||
filename: string; | ||
}; | ||
useNullAsDefault: boolean; | ||
} = (knexfile as any)[environment]; | ||
|
||
export default knex(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
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
Oops, something went wrong.