Skip to content

Commit

Permalink
Merge pull request #483 from splitgraph/external-catalog
Browse files Browse the repository at this point in the history
Enable external metastores
  • Loading branch information
gruuya authored Jan 3, 2024
2 parents 864f79c + 16a0daf commit ddf9c89
Show file tree
Hide file tree
Showing 27 changed files with 1,351 additions and 838 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
- name: Install protoc
run: sudo apt install -y protobuf-compiler

# Use https://github.com/marketplace/actions/rust-cache

Expand Down
38 changes: 38 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
members = ["clade"]

[package]
name = "seafowl"
Expand Down Expand Up @@ -44,6 +45,7 @@ base64 = "0.21.0"

bytes = "1.4.0"
chrono = { version = "0.4", default_features = false }
clade = { path = "clade" }
clap = { version = "3.2.19", features = [ "derive" ] }
config = "0.13.3"

Expand Down Expand Up @@ -90,6 +92,7 @@ sqlx = { version = "0.7.1", features = [ "runtime-tokio-rustls", "sqlite", "any"
strum = ">=0.24"
strum_macros = ">=0.24"
tempfile = "3"
thiserror = "1"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "signal", "process"] }
tonic = { version = "0.10.0", optional = true }
url = "2.2"
Expand All @@ -106,6 +109,7 @@ assert_cmd = "2"
assert_unordered = "0.3"
rstest = "*"
serial_test = "2"
tonic-reflection = "0.10"
wiremock = "0.5"

[build-dependencies]
Expand Down
11 changes: 11 additions & 0 deletions clade/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "clade"
version = "0.1.0"
edition = "2021"

[dependencies]
prost = "0.12"
tonic = "0.10"

[build-dependencies]
tonic-build = "0.10"
13 changes: 13 additions & 0 deletions clade/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use std::env;
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_build::configure()
.file_descriptor_set_path(out_dir.join("clade_descriptor.bin"))
.build_server(true)
.build_client(true)
.compile(&["proto/schema.proto"], &["proto"])?;

Ok(())
}
26 changes: 26 additions & 0 deletions clade/proto/schema.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

package clade.schema;

message SchemaObject {
string name = 1;
repeated TableObject tables = 2;
}

message TableObject {
string name = 1;
string location = 2;
}

message ListSchemaRequest {
string catalog_name = 1;
}

message ListSchemaResponse {
repeated SchemaObject schemas = 1;
}

service SchemaStoreService {
// List the available schemas
rpc ListSchemas(ListSchemaRequest) returns (ListSchemaResponse);
}
5 changes: 5 additions & 0 deletions clade/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub mod schema {
tonic::include_proto!("clade.schema");
pub const FILE_DESCRIPTOR_SET: &[u8] =
tonic::include_file_descriptor_set!("clade_descriptor");
}
Loading

0 comments on commit ddf9c89

Please sign in to comment.