-
Notifications
You must be signed in to change notification settings - Fork 0
Add Gel support #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Gel support #20
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dbe6f77
feat: add local database drizzle types
bnziv 62aaa79
PR fixes
bnziv 6631405
feat: add Gel docker setup
bnziv 343778f
feat: add Gel drizzle config
bnziv 759806b
feat: add Gel local config
bnziv 8ddbf6d
Merge branch 'main' into feat/geldb-support
bnziv 31aa73a
Merge branch 'main' into feat/geldb-support
bnziv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -77,17 +77,33 @@ BEGIN | |
| ); | ||
| END;`; | ||
|
|
||
| const gelUsers = `CREATE TABLE IF NOT EXISTS users ( | ||
| auth_sub VARCHAR(255) PRIMARY KEY, | ||
| created_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
| metadata JSON DEFAULT '{}'::json | ||
| );`; | ||
|
|
||
| const gelCountHistory = `CREATE TABLE IF NOT EXISTS count_history ( | ||
| uid INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY, | ||
| count INTEGER NOT NULL, | ||
| created_at TIMESTAMP NOT NULL DEFAULT NOW() | ||
| );`; | ||
| const gelUsers = `create type users { | ||
| create required property auth_sub: str { | ||
| create constraint exclusive; | ||
| }; | ||
|
|
||
| create required property created_at: datetime { | ||
| set default := datetime_current(); | ||
| }; | ||
|
|
||
| create required property metadata: json { | ||
| set default := to_json('{}'); | ||
| }; | ||
|
bnziv marked this conversation as resolved.
|
||
| };`; | ||
|
|
||
| const gelCountHistory = `create scalar type CountHistoryUid extending sequence; | ||
| create type count_history { | ||
| create required property uid: CountHistoryUid { | ||
| create constraint exclusive; | ||
| set default := sequence_next(introspect CountHistoryUid); | ||
| }; | ||
|
|
||
| create required property count: int16; | ||
|
|
||
| create required property created_at: datetime { | ||
| set default := datetime_current(); | ||
| }; | ||
| };`; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| export const userTables = { | ||
| cockroachdb: cockroachdbUsers, | ||
|
|
@@ -115,8 +131,8 @@ export const initTemplates = { | |
| wait: 'until (cockroach sql --insecure -e "select 1" >/dev/null 2>&1) ; do sleep 1; done' | ||
| }, | ||
| gel: { | ||
| cli: 'psql -U user -d database -c', | ||
| wait: 'until pg_isready -U user -h localhost --quiet; do sleep 1; done' | ||
| cli: 'gel query -H localhost -P 5656 -u admin --tls-security insecure -b main ', | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question as above about tls insecure |
||
| wait: 'until gel query -H localhost -P 5656 -u admin --tls-security insecure "select 1"; do sleep 1; done' | ||
| }, | ||
| mariadb: { | ||
| cli: 'MYSQL_PWD=userpassword mariadb -h127.0.0.1 -u user database -e', | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is using insecure a problem further down the line, like i think that means it needs to run on https correct? if its one of those things where its different for dev and prod we will need to put some sort of toggle