Skip to content

Commit

Permalink
Support for SQLite storage of ayb metadata (#100)
Browse files Browse the repository at this point in the history
* AybDb trait that supports SQLite and PostgreSQL depending on connection string

* Remove reliance on sqlx offline mode (we support multiple databases now)

* Add migrations & tests for SQLite, create data directory on start

* Add missing files for SQLite and tests, remove base test config

* Genericize duplicate constraint logic across SQLite and Postgres

* Allow parallel tests by removing shared state

* Cargo fmt

* Servers on different ports

* Update readme

* Version bump

* Clarification

* Ignore local reset script

* Ignore local reset script
  • Loading branch information
marcua authored Jun 4, 2023
1 parent 87c668c commit cfad960
Show file tree
Hide file tree
Showing 19 changed files with 448 additions and 369 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
--health-retries 5
ports:
- 5432:5432
env:
# Build binaries based on sqlx-data.json rather than live database,
# which isn't initialized yet for tests.
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v3
- name: Cargo cache
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
# Ignore ayb-specific files
ayb.toml
e2e.sh
tests/ayb_data
tests/ayb_data_postgres
tests/ayb_data_sqlite
ayb_data
reset_db.sh
142 changes: 112 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ayb"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
description = "ayb makes it easy to create, host, and share embedded databases like SQLite and DuckDB"
homepage = "https://github.com/marcua/ayb"
Expand All @@ -9,15 +9,17 @@ license = "Apache-2.0"

[dependencies]
actix-web = { version = "4.3.1" }
async-trait = { version = "0.1.68" }
clap = { version = "4.2.7", features = ["cargo", "derive", "env"] }
derive_more = { version = "0.99.0" }
dyn-clone = { version = "1.0.11" }
env_logger = { version = "0.10.0" }
reqwest = { version = "0.11.18", features = ["json"] }
rusqlite = { version = "0.29.0", features = ["bundled"] }
rusqlite = { version = "0.27.0", features = ["bundled"] }
regex = { version = "1.8.0"}
serde = { version = "1.0", features = ["derive"] }
serde_repr = { version = "0.1.11" }
sqlx = { version = "0.6.3", features = ["runtime-actix-native-tls", "postgres", "offline"] }
sqlx = { version = "0.6.3", features = ["runtime-actix-native-tls", "postgres", "sqlite"] }
toml = { version = "0.7.3" }
tokio = { version = "1.28.1", features = ["macros", "rt"] }
prettytable-rs = "0.10.0"
Expand Down
Loading

0 comments on commit cfad960

Please sign in to comment.