-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: database * fix: test CI * fix: timeout
- Loading branch information
Showing
46 changed files
with
1,571 additions
and
848 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
POSTGRES_DIR="./crates/adapter/src/postgres" | ||
DATABASE_URL="postgres://postgres:[email protected]:5432/postgrest" | ||
PKG_NAME=zksteve/frog | ||
BUILD_VERSION=$(shell git describe --long) | ||
BUILD_RELEASE=$(shell git describe --tags --abbrev=0) | ||
|
@@ -21,3 +23,18 @@ push: | |
docker push $(PKG_NAME)-server:$(BUILD_VERSION) && \ | ||
docker push $(PKG_NAME)-client:$(BUILD_VERSION) && \ | ||
docker push $(PKG_NAME)-worker:$(BUILD_VERSION) | ||
|
||
setup-db: | ||
diesel setup --database-url ${DATABASE_URL} \ | ||
--migration-dir ${POSTGRES_DIR}/migrations \ | ||
--config-file ${POSTGRES_DIR}/diesel.toml | ||
|
||
migrate: | ||
diesel migration run --database-url ${DATABASE_URL} \ | ||
--migration-dir ${POSTGRES_DIR}/migrations \ | ||
--config-file ${POSTGRES_DIR}/diesel.toml | ||
|
||
migrate-redo: | ||
diesel migration redo --database-url ${DATABASE_URL} \ | ||
--migration-dir ${POSTGRES_DIR}/migrations \ | ||
--config-file ${POSTGRES_DIR}/diesel.toml |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod http; | ||
pub mod in_memory; | ||
pub mod postgres; |
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 @@ | ||
use serde::Deserialize; | ||
|
||
#[derive(Deserialize, Debug, Clone)] | ||
pub struct DBConfig { | ||
pub url: String, | ||
pub max_size: usize, | ||
} |
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,9 @@ | ||
# For documentation on how to configure this file, | ||
# see https://diesel.rs/guides/configuring-diesel-cli | ||
|
||
[print_schema] | ||
custom_type_derives = ["diesel::query_builder::QueryId"] | ||
file = "schema.rs" | ||
|
||
[migrations_directory] | ||
dir = "migrations" |
6 changes: 6 additions & 0 deletions
6
crates/adapter/src/postgres/migrations/00000000000000_diesel_initial_setup/down.sql
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,6 @@ | ||
-- This file was automatically created by Diesel to setup helper functions | ||
-- and other internal bookkeeping. This file is safe to edit, any future | ||
-- changes will be added to existing projects as new migrations. | ||
|
||
DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass); | ||
DROP FUNCTION IF EXISTS diesel_set_updated_at(); |
Oops, something went wrong.