Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,34 @@ jobs:
- name: Run bindgen tests
run: cargo ci wasm-bindings

portable_datastore:
name: Check portable datastore
runs-on: spacetimedb-new-runner-2
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
steps:
- uses: actions/checkout@v3

- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- run: echo ::add-matcher::.github/workflows/rust_matcher.json

- name: Install wasm target
run: rustup target add wasm32-unknown-unknown

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ github.workspace }}
shared-key: spacetimedb
# Let the smoketests job save the cache since it builds the most things
save-if: false
prefix-key: v1

- name: Run portable datastore checks
run: cargo ci portable-datastore

publish_checks:
needs: [merge_queue_noop]
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }}
Expand Down
45 changes: 45 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
Expand Up @@ -25,6 +25,8 @@ members = [
"crates/paths",
"crates/pg",
"crates/physical-plan",
"crates/portable-datastore",
"crates/portable-datastore-wasm",
"crates/primitives",
"crates/query",
"crates/runtime",
Expand All @@ -39,6 +41,7 @@ members = [
"crates/standalone",
"crates/subscription",
"crates/table",
"crates/test-datastore",
"crates/testing",
"crates/update",
"modules/benchmarks",
Expand Down Expand Up @@ -159,6 +162,7 @@ spacetimedb-standalone = { path = "crates/standalone", version = "=2.7.0" }
spacetimedb-subscription = { path = "crates/subscription", version = "=2.7.0" }
spacetimedb-sql-parser = { path = "crates/sql-parser", version = "=2.7.0" }
spacetimedb-table = { path = "crates/table", version = "=2.7.0" }
spacetimedb-test-datastore = { path = "crates/test-datastore", version = "=2.7.0" }

# Prevent `ahash` from pulling in `getrandom` by disabling default features.
# Modules use `getrandom02` and we need to prevent an incompatible version
Expand Down
36 changes: 18 additions & 18 deletions crates/bindings-csharp/BSATN.Runtime/QueryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ public IxJoinEq<TRow, TOtherRow> Eq<TOtherRow>(IxCol<TOtherRow, TValue> other) =
public override string ToString() => RefSql;
}

public sealed class Table<TRow, TCols, TIxCols> : IQuery<TRow>
public sealed class TableQuery<TRow, TCols, TIxCols> : IQuery<TRow>
{
private readonly string tableName;
private readonly TCols cols;
private readonly TIxCols ixCols;

public Table(string tableName, TCols cols, TIxCols ixCols)
public TableQuery(string tableName, TCols cols, TIxCols ixCols)
{
this.tableName = tableName;
this.cols = cols;
Expand Down Expand Up @@ -227,7 +227,7 @@ public LeftSemiJoin<TRow, TCols, TIxCols, TRightRow, TRightCols, TRightIxCols> L
TRightCols,
TRightIxCols
>(
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
Func<TIxCols, TRightIxCols, IxJoinEq<TRow, TRightRow>> on
) => new(this, right, on(ixCols, right.ixCols), whereExpr: null);

Expand All @@ -236,17 +236,17 @@ public RightSemiJoin<TRow, TCols, TIxCols, TRightRow, TRightCols, TRightIxCols>
TRightCols,
TRightIxCols
>(
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
Func<TIxCols, TRightIxCols, IxJoinEq<TRow, TRightRow>> on
) => new(this, right, on(ixCols, right.ixCols), leftWhereExpr: null);
}

public sealed class FromWhere<TRow, TCols, TIxCols> : IQuery<TRow>
{
private readonly Table<TRow, TCols, TIxCols> table;
private readonly TableQuery<TRow, TCols, TIxCols> table;
private readonly BoolExpr<TRow> expr;

internal FromWhere(Table<TRow, TCols, TIxCols> table, BoolExpr<TRow> expr)
internal FromWhere(TableQuery<TRow, TCols, TIxCols> table, BoolExpr<TRow> expr)
{
this.table = table;
this.expr = expr;
Expand Down Expand Up @@ -274,7 +274,7 @@ public LeftSemiJoin<TRow, TCols, TIxCols, TRightRow, TRightCols, TRightIxCols> L
TRightCols,
TRightIxCols
>(
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
Func<TIxCols, TRightIxCols, IxJoinEq<TRow, TRightRow>> on
) => new(table, right, on(table.IxCols, right.IxCols), expr);

Expand All @@ -283,7 +283,7 @@ public RightSemiJoin<TRow, TCols, TIxCols, TRightRow, TRightCols, TRightIxCols>
TRightCols,
TRightIxCols
>(
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
Func<TIxCols, TRightIxCols, IxJoinEq<TRow, TRightRow>> on
) => new(table, right, on(table.IxCols, right.IxCols), expr);
}
Expand All @@ -297,15 +297,15 @@ public sealed class LeftSemiJoin<
TRightIxCols
> : IQuery<TLeftRow>
{
private readonly Table<TLeftRow, TLeftCols, TLeftIxCols> left;
private readonly Table<TRightRow, TRightCols, TRightIxCols> right;
private readonly TableQuery<TLeftRow, TLeftCols, TLeftIxCols> left;
private readonly TableQuery<TRightRow, TRightCols, TRightIxCols> right;
private readonly string leftJoinRefSql;
private readonly string rightJoinRefSql;
private readonly BoolExpr<TLeftRow>? whereExpr;

internal LeftSemiJoin(
Table<TLeftRow, TLeftCols, TLeftIxCols> left,
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TLeftRow, TLeftCols, TLeftIxCols> left,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
IxJoinEq<TLeftRow, TRightRow> join,
BoolExpr<TLeftRow>? whereExpr
)
Expand Down Expand Up @@ -408,16 +408,16 @@ public sealed class RightSemiJoin<
TRightIxCols
> : IQuery<TRightRow>
{
private readonly Table<TLeftRow, TLeftCols, TLeftIxCols> left;
private readonly Table<TRightRow, TRightCols, TRightIxCols> right;
private readonly TableQuery<TLeftRow, TLeftCols, TLeftIxCols> left;
private readonly TableQuery<TRightRow, TRightCols, TRightIxCols> right;
private readonly string leftJoinRefSql;
private readonly string rightJoinRefSql;
private readonly BoolExpr<TLeftRow>? leftWhereExpr;
private readonly BoolExpr<TRightRow>? rightWhereExpr;

internal RightSemiJoin(
Table<TLeftRow, TLeftCols, TLeftIxCols> left,
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TLeftRow, TLeftCols, TLeftIxCols> left,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
IxJoinEq<TLeftRow, TRightRow> join,
BoolExpr<TLeftRow>? leftWhereExpr,
BoolExpr<TRightRow>? rightWhereExpr
Expand All @@ -432,8 +432,8 @@ internal RightSemiJoin(
}

internal RightSemiJoin(
Table<TLeftRow, TLeftCols, TLeftIxCols> left,
Table<TRightRow, TRightCols, TRightIxCols> right,
TableQuery<TLeftRow, TLeftCols, TLeftIxCols> left,
TableQuery<TRightRow, TRightCols, TRightIxCols> right,
IxJoinEq<TLeftRow, TRightRow> join,
BoolExpr<TLeftRow>? leftWhereExpr
)
Expand Down
4 changes: 2 additions & 2 deletions crates/bindings-csharp/Codegen.Tests/fixtures/client/Lib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public PublicTableIxCols(string tableName)
}
}

private static Table<PublicTable, PublicTableCols, PublicTableIxCols> MakeTable()
private static TableQuery<PublicTable, PublicTableCols, PublicTableIxCols> MakeTable()
{
const string tableName = "PublicTable";
return new Table<PublicTable, PublicTableCols, PublicTableIxCols>(
return new TableQuery<PublicTable, PublicTableCols, PublicTableIxCols>(
tableName,
new PublicTableCols(tableName),
new PublicTableIxCols(tableName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THI
}
},
{/*
public global::SpacetimeDB.Table<global::InAnotherNamespace.TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
public global::SpacetimeDB.TableQuery<global::InAnotherNamespace.TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
new("TestDuplicateTableName", new TestDuplicateTableNameCols("TestDuplicateTableName"), new TestDuplicateTableNameIxCols("TestDuplicateTableName"));
^^^^^^^^^^^^^^^^^^^^^^^^^^
}
Expand All @@ -368,7 +368,7 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THI
}
},
{/*
public global::SpacetimeDB.Table<global::TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
public global::SpacetimeDB.TableQuery<global::TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
new("TestDuplicateTableName", new TestDuplicateTableNameCols("TestDuplicateTableName"), new TestDuplicateTableNameIxCols("TestDuplicateTableName"));
^^^^^^^^^^^^^^^^^^^^^^^^^^
}
Expand All @@ -391,7 +391,7 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THI
}
},
{/*
public global::SpacetimeDB.Table<global::InAnotherNamespace.TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
public global::SpacetimeDB.TableQuery<global::InAnotherNamespace.TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
new("TestDuplicateTableName", new TestDuplicateTableNameCols("TestDuplicateTableName"), new TestDuplicateTableNameIxCols("TestDuplicateTableName"));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
Expand All @@ -414,7 +414,7 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THI
}
},
{/*
public global::SpacetimeDB.Table<global::TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
public global::SpacetimeDB.TableQuery<global::TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
new("TestDuplicateTableName", new TestDuplicateTableNameCols("TestDuplicateTableName"), new TestDuplicateTableNameIxCols("TestDuplicateTableName"));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
Expand Down Expand Up @@ -576,8 +576,8 @@ public readonly struct TestDuplicateTableNameIxCols
},
{/*
{
public global::SpacetimeDB.Table<global::TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
^^^^^^^^^^^^^^^^^^^^^^
public global::SpacetimeDB.TableQuery<global::TestDuplicateTableName, TestDuplicateTableNameCols, TestDuplicateTableNameIxCols> TestDuplicateTableName() =>
^^^^^^^^^^^^^^^^^^^^^^
new("TestDuplicateTableName", new TestDuplicateTableNameCols("TestDuplicateTableName"), new TestDuplicateTableNameIxCols("TestDuplicateTableName"));
*/
Message: Type 'QueryBuilder' already defines a member called 'TestDuplicateTableName' with the same parameter types,
Expand Down
Loading
Loading