Skip to content

Commit 139e794

Browse files
Leonid Ryzhykryzhyk
authored andcommitted
[sql] Prepare to publish sqllib on crates.io.
We would like to publish sqllib on crates.io to simplify development and debugging of UDFs. This commit: - Moves `sqllib` to `/crates` - Renames it to `feldera-sqllib` - Prepares to publish it on crates.io with the next release. Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
1 parent c0a5a76 commit 139e794

35 files changed

Lines changed: 66 additions & 59 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ Finally, add new versions tn crates.io for the following crates:
302302
cargo publish --package feldera-types
303303
cargo publish --package dbsp
304304
cargo publish --package fda
305+
cargo publish --package feldera-sqllib
305306
```
306307

307308
### Phase 2: post-release commit

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ members = [
66
"crates/nexmark",
77
"crates/feldera-types",
88
"crates/pipeline-manager",
9+
"crates/sqllib",
910
"sql-to-dbsp-compiler/lib/json",
1011
"sql-to-dbsp-compiler/lib/readers",
11-
"sql-to-dbsp-compiler/lib/sqllib",
1212
]
1313
exclude = [
1414
"sql-to-dbsp-compiler/temp",
@@ -21,4 +21,4 @@ resolver = "2"
2121
release = false
2222

2323
[profile.bench]
24-
debug = true
24+
debug = true

Earthfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ test-adapters:
218218
redpanda start --smp 2 && \
219219
(google-cloud-sdk/bin/gcloud beta emulators pubsub start --project=feldera-test --host-port=127.0.0.1:8685 &) && \
220220
sleep 5 && \
221-
RUST_BACKTRACE=1 cargo test --package dbsp_adapters --features "pubsub-emulator-test" --package sqllib
221+
RUST_BACKTRACE=1 cargo test --package dbsp_adapters --features "pubsub-emulator-test" --package feldera-sqllib
222222
END
223223

224224
test-manager:
@@ -317,6 +317,7 @@ build-pipeline-manager-container:
317317
COPY crates/feldera-types database-stream-processor/crates/feldera-types
318318
COPY crates/adapters database-stream-processor/crates/adapters
319319
COPY crates/nexmark database-stream-processor/crates/nexmark
320+
COPY crates/sqllib database-stream-processor/crates/sqllib
320321
COPY README.md database-stream-processor/README.md
321322

322323
# Then copy over the required SQL compiler files

crates/adapters/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ serial_test = "2.0.0"
133133
rust_decimal_macros = "1.32"
134134
mockall = "0.12.1"
135135
pretty_assertions = "1.4.0"
136-
sqllib = { path = "../../sql-to-dbsp-compiler/lib/sqllib" }
136+
feldera-sqllib = { path = "../sqllib" }
137137
num-bigint = "0.4.4"
138138
google-cloud-googleapis = "0.15.0"

crates/adapters/src/format/avro/serializer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,12 +791,12 @@ mod test {
791791
from_avro_datum, to_avro_datum, types::Value as AvroValue, Decimal, Schema as AvroSchema,
792792
};
793793
use dbsp::algebra::{F32, F64};
794+
use feldera_sqllib::{Date, Timestamp};
794795
use feldera_types::{serde_with_context::SerializeWithContext, serialize_table_record};
795796
use num_bigint::BigInt;
796797
use rust_decimal::Decimal as RustDecimal;
797798
use rust_decimal_macros::dec;
798799
use serde::Serialize;
799-
use sqllib::{Date, Timestamp};
800800
use std::collections::{BTreeMap, HashMap};
801801
use std::str::FromStr;
802802

crates/adapters/src/test/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use arrow::array::{
44
};
55
use arrow::datatypes::{DataType, Schema, TimeUnit};
66
use dbsp::utils::Tup2;
7+
use feldera_sqllib::{Date, Timestamp};
78
use feldera_types::program_schema::{ColumnType, Field, Relation, SqlIdentifier, SqlType};
89
use feldera_types::{
910
deserialize_table_record, deserialize_without_context, serialize_struct, serialize_table_record,
@@ -12,7 +13,6 @@ use prop::sample::SizeRange;
1213
use proptest::{collection, prelude::*};
1314
use proptest_derive::Arbitrary;
1415
use size_of::SizeOf;
15-
use sqllib::{Date, Timestamp};
1616
use std::collections::BTreeMap;
1717
use std::string::ToString;
1818
use std::sync::Arc;

crates/adapters/src/transport/datagen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,14 +1564,14 @@ mod test {
15641564
use crate::test::{mock_input_pipeline, MockDeZSet, MockInputConsumer, TestStruct2};
15651565
use crate::InputReader;
15661566
use anyhow::Result as AnyResult;
1567+
use feldera_sqllib::binary::ByteArray;
1568+
use feldera_sqllib::{Date, Time, Timestamp};
15671569
use feldera_types::config::{InputEndpointConfig, TransportConfig};
15681570
use feldera_types::program_schema::{ColumnType, Field, Relation, SqlType};
15691571
use feldera_types::serde_with_context::{DeserializeWithContext, SqlSerdeConfig};
15701572
use feldera_types::transport::datagen::GenerationPlan;
15711573
use feldera_types::{deserialize_table_record, serialize_table_record};
15721574
use size_of::SizeOf;
1573-
use sqllib::binary::ByteArray;
1574-
use sqllib::{Date, Time, Timestamp};
15751575
use std::collections::BTreeMap;
15761576
use std::time::Duration;
15771577
use std::{env, thread};

sql-to-dbsp-compiler/lib/sqllib/Cargo.toml renamed to crates/sqllib/Cargo.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
[package]
2-
name = "sqllib"
3-
version = "0.1.0"
2+
name = "feldera-sqllib"
3+
version = "0.26.0"
44
edition = "2021"
5-
publish = false
5+
license = "MIT"
6+
description = "SQL runtime library for Feldera"
7+
homepage = "https://github.com/feldera/feldera"
8+
repository = "https://github.com/feldera/feldera"
9+
keywords = ["DBSP", "streaming", "analytics", "database", "sql"]
10+
categories = ["database", "api-bindings", "network-programming"]
11+
publish = true
612

713
[dependencies]
814
thiserror = "1.0"
9-
dbsp = { path = "../../../crates/dbsp" }
10-
feldera-types = { path = "../../../crates/feldera-types" }
15+
dbsp = { path = "../dbsp" }
16+
feldera-types = { path = "../feldera-types" }
1117
itertools = { version = "0.13.0" }
1218
# `serde-with-arbitrary-precision` is needed because we enable `arbitrary_precision` in `serde_json`.
1319
rust_decimal = { package = "feldera_rust_decimal", version = "1.33.1-feldera.1", features = ["maths", "rkyv", "serde-float", "serde-arbitrary-precision"] }
1420
geo = { version = "0.26.0" }
15-
geo-types = { version = "0.7" }
1621
size-of = { version = "0.1.5", package = "feldera-size-of", features = ["rust_decimal"] }
1722
serde = { version = "1.0", features = ["derive"] }
1823
serde_json = { version = "1.0.127", features = ["arbitrary_precision"] }
File renamed without changes.

0 commit comments

Comments
 (0)