-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug where
number
type is too small for unix epoch in some SQL…
… variants (#42) - Fixed bug where `number` type is too small for unix epoch in some SQL variants - Fixed bug where only SQLite was tested against `dwn-sdk-js` test suite for `ReumsableTaskStore` (the reason why the bug was not caught) - Special handling for PostgreSQL on `bigint`
- Loading branch information
1 parent
5b7468b
commit 5d1759b
Showing
4 changed files
with
38 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SQL Dialect Variations | ||
|
||
We use `Kysely` to help us abstract differences between SQL variants in this codebase. Unfortunately many differences are not fully abstracted away. This document outlines the specific handling required in this codebase to support variations between MySQL, PostgreSQL, and SQLite. Its purpose is to help future repository maintainers avoid known pitfalls. Note that this may not be an exhaustive list of all special handling within the codebase. | ||
|
||
## MySQL | ||
|
||
- Does not support adding a reference column directly, requires adding a foreign key constraint instead. | ||
|
||
- When inserting values into a table, the inserted values are returned by default, unlike PostgreSQL and SQLite. | ||
|
||
|
||
## PostgreSQL | ||
|
||
- Uses a special type: `serial` for auto-increment columns. | ||
|
||
- Uses a special type: `bytea` for blob columns. | ||
|
||
- `bigint` column type gets returned as `string` in `pg` library. | ||
|
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