diff --git a/packages/apalis-sql/Cargo.toml b/packages/apalis-sql/Cargo.toml deleted file mode 100644 index 9a72d29..0000000 --- a/packages/apalis-sql/Cargo.toml +++ /dev/null @@ -1,56 +0,0 @@ -[package] -name = "apalis-sql" -version = "0.7.3" -authors = ["Njuguna Mureithi "] -edition.workspace = true -repository.workspace = true -readme = "../../README.md" - -license = "MIT" -description = "SQL Storage for apalis. Use sqlite, postgres and mysql for background job processing" - -[features] -default = ["migrate"] -postgres = ["sqlx/postgres", "sqlx/json"] -sqlite = ["sqlx/sqlite", "sqlx/json"] -mysql = ["sqlx/mysql", "sqlx/json", "sqlx/bigdecimal"] -migrate = ["sqlx/migrate", "sqlx/macros"] -async-std-comp = ["async-std", "sqlx/runtime-async-std-rustls"] -async-std-comp-native-tls = ["async-std", "sqlx/runtime-async-std-native-tls"] -tokio-comp = ["tokio", "sqlx/runtime-tokio-rustls"] -tokio-comp-native-tls = ["tokio", "sqlx/runtime-tokio-native-tls"] - -[dependencies.sqlx] -version = "0.8.1" -default-features = false -features = ["chrono"] - -[dependencies] -serde = { version = "1", features = ["derive"] } -serde_json = "1" -apalis-core = { path = "../../packages/apalis-core", version = "0.7.3", default-features = false, features = [ - "sleep", - "json", -] } -log = "0.4.21" -futures = "0.3.30" -async-stream = "0.3.5" -tokio = { version = "1", features = ["rt", "net"], optional = true } -futures-lite = "2.3.0" -async-std = { version = "1.13.0", optional = true } -chrono = { version = "0.4", features = ["serde"] } -thiserror = "2.0.0" - - -[dev-dependencies] -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } -email-service = { path = "../../examples/email-service" } -apalis = { path = "../../", default-features = false } -once_cell = "1.19.0" -apalis-sql = { path = ".", features = ["tokio-comp"] } -apalis-core = { path = "../apalis-core", features = ["test-utils"] } - -[package.metadata.docs.rs] -# defines the configuration attribute `docsrs` -rustdoc-args = ["--cfg", "docsrs"] -all-features = true diff --git a/packages/apalis-sql/build.rs b/packages/apalis-sql/build.rs deleted file mode 100644 index 3a8149e..0000000 --- a/packages/apalis-sql/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("cargo:rerun-if-changed=migrations"); -} diff --git a/packages/apalis-sql/migrations/sqlite/20220530084123_jobs_workers.sql b/packages/apalis-sql/migrations/sqlite/20220530084123_jobs_workers.sql deleted file mode 100644 index 5883b48..0000000 --- a/packages/apalis-sql/migrations/sqlite/20220530084123_jobs_workers.sql +++ /dev/null @@ -1,36 +0,0 @@ -CREATE TABLE IF NOT EXISTS Workers ( - id TEXT NOT NULL UNIQUE, - worker_type TEXT NOT NULL, - storage_name TEXT NOT NULL, - layers TEXT, - last_seen INTEGER NOT NULL DEFAULT (strftime('%s', 'now')) -); - -CREATE INDEX IF NOT EXISTS Idx ON Workers(id); - -CREATE INDEX IF NOT EXISTS WTIdx ON Workers(worker_type); - -CREATE INDEX IF NOT EXISTS LSIdx ON Workers(last_seen); - -CREATE TABLE IF NOT EXISTS Jobs ( - job TEXT NOT NULL, - id TEXT NOT NULL UNIQUE, - job_type TEXT NOT NULL, - status TEXT NOT NULL DEFAULT 'Pending', - attempts INTEGER NOT NULL DEFAULT 0, - max_attempts INTEGER NOT NULL DEFAULT 25, - run_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), - last_error TEXT, - lock_at INTEGER, - lock_by TEXT, - done_at INTEGER, - FOREIGN KEY(lock_by) REFERENCES Workers(id) -); - -CREATE INDEX IF NOT EXISTS TIdx ON Jobs(id); - -CREATE INDEX IF NOT EXISTS SIdx ON Jobs(status); - -CREATE INDEX IF NOT EXISTS LIdx ON Jobs(lock_by); - -CREATE INDEX IF NOT EXISTS JTIdx ON Jobs(job_type); \ No newline at end of file diff --git a/packages/apalis-sql/migrations/sqlite/20250313213411_add_job_priority.sql b/packages/apalis-sql/migrations/sqlite/20250313213411_add_job_priority.sql deleted file mode 100644 index 030fda7..0000000 --- a/packages/apalis-sql/migrations/sqlite/20250313213411_add_job_priority.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE Jobs -ADD priority INTEGER NOT NULL DEFAULT 0;