Skip to content

Commit bf64346

Browse files
committed
feat(database): Add MySQL database source with scheduled query execution
This commit adds a new `database` source. A new database source to query data from MySQL databases at scheduled intervals using cron expressions.
1 parent 8057e63 commit bf64346

File tree

8 files changed

+516
-23
lines changed

8 files changed

+516
-23
lines changed

Cargo.lock

Lines changed: 166 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ serde_json.workspace = true
275275
serde_with = { version = "3.12.0", default-features = false, features = ["macros", "std"] }
276276
serde_yaml = { version = "0.9.34", default-features = false }
277277

278+
# Databases
279+
mysql = { version = "26.0.0", features = ["chrono", "native-tls", "buffer-pool"], optional = true }
280+
278281
# Messagepack
279282
rmp-serde = { version = "1.3.0", default-features = false, optional = true }
280283
rmpv = { version = "1.3.0", default-features = false, features = ["with-serde"], optional = true }
@@ -321,6 +324,7 @@ bytesize = { version = "2.0.1", default-features = false }
321324
chrono.workspace = true
322325
chrono-tz.workspace = true
323326
colored = { version = "3.0.0", default-features = false }
327+
cron = { version = "0.15.0", features = ["serde"], default-features = false, optional = true }
324328
csv = { version = "1.3", default-features = false }
325329
databend-client = { version = "0.22.2", default-features = false, features = ["rustls"], optional = true }
326330
derivative = { version = "2.2.0", default-features = false }
@@ -565,6 +569,7 @@ sources-logs = [
565569
"sources-aws_kinesis_firehose",
566570
"sources-aws_s3",
567571
"sources-aws_sqs",
572+
"sources-database",
568573
"sources-datadog_agent",
569574
"sources-demo_logs",
570575
"sources-docker_logs",
@@ -613,6 +618,7 @@ sources-aws_ecs_metrics = ["sources-utils-http-client"]
613618
sources-aws_kinesis_firehose = ["dep:base64"]
614619
sources-aws_s3 = ["aws-core", "dep:aws-sdk-sqs", "dep:aws-sdk-s3", "dep:async-compression", "sources-aws_sqs", "tokio-util/io"]
615620
sources-aws_sqs = ["aws-core", "dep:aws-sdk-sqs"]
621+
sources-database = ["dep:mysql", "dep:cron"]
616622
sources-datadog_agent = ["sources-utils-http-error", "protobuf-build", "dep:prost"]
617623
sources-demo_logs = ["dep:fakedata"]
618624
sources-dnstap = ["sources-utils-net-tcp", "dep:base64", "dep:hickory-proto", "dep:dnsmsg-parser", "dep:dnstap-parser", "protobuf-build", "dep:prost"]
@@ -914,6 +920,7 @@ axiom-integration-tests = ["sinks-axiom"]
914920
azure-blob-integration-tests = ["sinks-azure_blob"]
915921
chronicle-integration-tests = ["sinks-gcp"]
916922
clickhouse-integration-tests = ["sinks-clickhouse"]
923+
database-integration-tests = ["sources-database"]
917924
databend-integration-tests = ["sinks-databend"]
918925
datadog-agent-integration-tests = ["sources-datadog_agent"]
919926
datadog-logs-integration-tests = ["sinks-datadog_logs"]

0 commit comments

Comments
 (0)