Commit Graph

164 Commits

Author SHA1 Message Date
Tyler Cloutier 5403b47cb8 Consolidated all ts code into the spacetimedb package and now sdk is a shim reexport 2025-09-18 15:19:54 -04:00
Tyler Cloutier d3bac1d7ae It's a bit of a mess 2025-09-18 15:19:54 -04:00
Mario Montoya 8adef2b93b Support for the PG wire protocol (#2702)
# Description of Changes

Closes
[#2686](https://github.com/clockworklabs/SpacetimeDB/issues/2686).

Add support for listening using the [PG wire
protocol](https://www.postgresql.org/docs/current/protocol.html) so `pg`
clients could be used against the database.

# API and ABI breaking changes

The output of `duration` is changed to `rfc3339`, instead of the way is
made with `sats` because is what is done in `pg`, see note below.

# Expected complexity level and risk

2

~~There is open questions that are in the [ticket
#2686](https://github.com/clockworklabs/SpacetimeDB/issues/2686). Also
the crate used here require `RustTls`, so it could be good idea to
decide if~~:

* ~~Rewrite a big chunk of code to use `OpenSSL`~~
* ~~Move to `RustTls`
https://github.com/clockworklabs/SpacetimeDB/pull/1700~~
* ~~Pay for the extra compilation cost~~.

I open another port(`5433`) to listen for `pg` connections using `ssl`.
Need to be decided if this is the way or instead try to multi-plex the
current port for both protocols.

# Testing

Only manual testing so far. Solving the above questions allow me to
implement some unit tests. Also, not yet integrated into cloud for the
same reasons.

- [x] Adding some test for the binary encoding of special and primitive
types
- [x] Smoke test using `psql` that connect to the db instance and run
some queries
- [x] Manually inspect using a UI database explorer how infer the types,
some of this tools generate special widgets when displaying `json,
duration, etc`

---------

Co-authored-by: Noa <coolreader18@gmail.com>
2025-09-10 19:58:03 +00:00
Tyler Cloutier ada45d464f Adds TypeBuilders and ColumnBuilders for specifying the schema of a TypeScript module (#3208)
# Description of Changes

This is a purely additive change to introduce, `TypeBuilder`s,
`ColumnBuilder`s, and a `t` factory export that has methods for creating
`TypeBuilder`s.

There are derived types from `TypeBuilder`s for each variant of
`AlgebraicType`. `TypeBuilder`s can be converted into a `ColumnBuilder`
which supports creating additional metadata specifying whether a column
is a primary key or should be unique. `ColumnBuilder`s are not allowed
within `TypeBuilder`s, but the opposite is allowed (for composite
types).

`ColumnBuilder`s can only be used at the top level and contain a
`TypeBuilder`.

`TypeBuilder` stores three pieces of information:

1. A phantom typescript type that the SATS type should be interpreted as
in TS
2. A phantom typescript type which is the type of the SATS type
3. A runtime AlgebraicType which stores the information to be reported
to host.

`ColumnBuilder` stores three pieces of information:

1. A `TypeBuilder`
2. A phantom typescript type with the column metadata
3. A runtime `ColumnMetadata` which stores the information to be
reported to the host.

Additionally, it is only possible to add metadata to `ColumnBuilder` or
`TypeBuilder` types which are compatible with that metadata. e.g. It is
a compile-time error to add `isAutoIncrementing` to a `String`
type/column.

# API and ABI breaking changes

None

# Expected complexity level and risk

2

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] I've created a set of type tests in `type_builders.test-d.ts`
- [x] I also created a set of runtime tests in `index.test.ts`
- [x] I have modified CI so that these tests run on every PR
2025-09-08 15:44:04 +00:00
Tyler Cloutier 413c8cbf3c Unifies TypeScript packages and command names (#3195)
# Description of Changes

This PR:
 - standardizes the prettier config across all TypeScript projects
 - adds a root level package.json
 - standardizes all `pnpm` commands to be the same
 - updates documentation accordingly
- adds some additional typescript testing for serialization and
deserialization
 
**IMPORTANT!** Once this PR merges we will need to change the
`compile-and-test` required check to `build-and-test`

# API and ABI breaking changes

No breaking changes.

# Expected complexity level and risk

2 - It in principle doesn't change any code, but could affect deploy
processes.

# Testing

- [x] Just the automated testing that we had previously
- [x] I added additional automated tests

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-09-04 02:23:29 +00:00
Zeke Foppa 726345206f CI - License checks (#3197)
# Description of Changes

- Checks that all `LICENSE`/`LICENSE.txt` files are symlinks to
something in `licenses/`
- Checks that all license symlinks are valid
- Adds Tyler as a codeowner for `LICENSE`

# API and ABI breaking changes

None.

# Expected complexity level and risk

2

# Testing

- [x] new CI fails on this PR (because
https://github.com/clockworklabs/SpacetimeDB/pull/3193 isn't merged yet)
- [x] new CI passes on a test PR with
https://github.com/clockworklabs/SpacetimeDB/pull/3193 merged in
(https://github.com/clockworklabs/SpacetimeDB/pull/3198)

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-09-03 19:55:41 +00:00
Zeke Foppa d8505596b7 CI - Fix caching in C#/Unity testsuite (#3194)
# Description of Changes

We had weird caching issues in the C#/Unity testsuite. Somehow, they got
triggered only as of
https://github.com/clockworklabs/SpacetimeDB/pull/3181 merging, and I
have no idea why/how.

I've restored the `id` field of the checkout step (which is used by the
cache step), and this _seems_ to have fixed it.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

- [x] It passes on this PR
- [x] It passes in a test PR that combines this change with
https://github.com/clockworklabs/SpacetimeDB/pull/3182

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-21 18:35:52 +00:00
Zeke Foppa ed7de0da97 CI - Remove bots please (#3102)
# Description of Changes

We haven't used this in a while and we're pretty sure it's currently
broken.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

None

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-04 16:00:02 +00:00
Zeke Foppa f664a63891 CI - Make new CI checks run in merge queue (#3016)
# Description of Changes

A few of our new CI checks weren't set up to run in the merge queue,
which prevented PRs from merging when those checks were marked required.

# API and ABI breaking changes

None. CI only change.

# Expected complexity level and risk

1

# Testing

This will have to be tested by making these checks required again, and
then seeing if this PR can merge.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-01 18:36:11 +00:00
Zeke Foppa 0d0f824eb4 CI - Set Unity testsuite timeout to 30m (#3015)
# Description of Changes

Just what it says on the can. This test suite can sometimes mysteriously
hang for a long time, so a timeout will help kill this (and free up
resources) earlier.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

None really. I guess I could test this by adding a step that just sleeps
forever, but this is basically just setting some data.

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-01 16:55:09 +00:00
Zeke Foppa 679ebe5678 CI - C#/Unity test suite concurrency improvements (#3001)
# Description of Changes

New Unity test suite runs will cancel existing in-progress runs on the
same PR or github ref.

I tried to add a global limit of 2 test suites running at the same time,
but I did not find a successful way of making this work.

# API and ABI breaking changes

None. CI-only change.

# Expected complexity level and risk

1

# Testing
- [x] Test suite still runs and succeeds
- [x] If I push several commits in a row, previous runs get cancelled

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-29 19:05:02 +00:00
Zeke Foppa 797eea8575 CI - Monorepo tweaks (#3000)
# Description of Changes

Some small CI tweaks related to the monorepo merge.

Once we've landed these, I think we can make most of the new checks
required.

# API and ABI breaking changes

CI only changes

# Expected complexity level and risk

1

# Testing

None, just tweaked names.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-29 17:58:03 +00:00
Zeke Foppa e0ae18c99e CI - Check C# quickstart-chat bindings are up to date (#2979)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-25 17:49:27 +00:00
Zeke Foppa 6c9aebdbf3 Docs CI - Check that nav.js matches the .md files list (#2984)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-25 16:54:25 +00:00
Kim Altintop 50fd07af4d ci: Skip the Unity tests if the PR is an external contribution (#2978) 2025-07-25 04:59:13 +00:00
Kim Altintop 6b9b0e3b81 smoketests: Fix server restarts and make more robust (#2977) 2025-07-23 15:29:43 +00:00
Kim Altintop 6979df59f6 ci: Temporarily disable zz_docker tests (#2974) 2025-07-22 18:24:29 +00:00
Zeke Foppa ca66340315 Disable musl builds (#2964)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-21 18:48:03 +00:00
Zeke Foppa ccc4d06ddb Update GitHub files for C#/Unity SDK (#2952)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-21 14:44:47 +00:00
Zeke Foppa 7afa0b4cce Docs import - Update GitHub-related files (#2949)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-17 16:24:09 +00:00
Zeke Foppa cbba2b29c1 Fix up GitHub files related to TypeScript SDK (#2943)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-07-16 19:32:04 +00:00
Noa 742303ca49 Bump rust-toolchain to rust 1.88 (#2749)
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2025-07-15 17:39:41 +00:00
Zeke Foppa fae2c7ece3 CI - Remove outdated Contributor Membership Check (#2827)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-06-04 16:57:21 +00:00
Viktor Szépe f6da9e1f5f Fix typos (#2812)
Signed-off-by: Viktor Szépe <viktor@szepe.net>
2025-06-04 16:33:32 +00:00
Kim Altintop f14d7cf5e2 ci: Update dependencies for the wasm_bindings job (#2717) 2025-05-19 07:53:18 +00:00
Jeffrey Dallatezza 14ba750155 Add information about the CLI version to generated code. (#2673) 2025-05-01 21:17:30 +00:00
Noa 020d64c1f1 Split client codegen out into its own crate (#2593)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-29 17:54:25 +00:00
Kim Altintop 7f0502ecf7 Replication Smoketest Cleanups (#2675)
Co-authored-by: Shubham Mishra <shubham@clockworklabs.io>
Co-authored-by: Shubham Mishra <shivam828787@gmail.com>
2025-04-28 11:39:07 +00:00
Zeke Foppa 118e59de14 CI - Do some basic checks that crates are publishable (#2660)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-23 17:08:43 +00:00
Zeke Foppa 2d0b4127c2 CI - Test spacetimedb-update self-install (#2637)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-19 01:44:20 +00:00
Zeke Foppa 4ec9d11e7a CI - Fix job that packages the CLI for release (#2617)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-04-15 22:00:52 +00:00
Phoebe Goldman 80b3613f45 Add CI job to run cargo doc on the bindings crate (#2548) 2025-04-03 17:41:17 +00:00
Noa f2a4abbf4b Update PR template (#2395)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-04-01 16:55:08 +00:00
james gilles 1d0dc6da7b Fix C# SDK Tests (#2533) 2025-03-31 18:35:41 +00:00
Zeke Foppa 4dca52fef3 CI - Make Test Suite check for dirty git diff (#2531)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-03-31 17:25:18 +00:00
Zeke Foppa 9bd75787c9 CI - Containerize linux x86_64 GNU builds (#2466)
Co-authored-by: Noa <coolreader18@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-03-28 03:25:32 +00:00
Noa 80ad69ca14 Build for musl (#2418) 2025-03-20 04:19:27 +00:00
Kim Altintop c2c19c6b7a smoketests: Test database deletion (#2480) 2025-03-19 16:31:50 +00:00
Zeke Foppa 4d04ab0493 CI - Fix docker jobs failing (#2471)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-03-14 19:14:27 +00:00
Zeke Foppa 644645b733 Make the tools/merge-docker-images.sh script more generic (#2334)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-03-11 17:07:48 +00:00
Zeke Foppa d04335f9a2 Add @jdetter back to CLI codeowners (#2350)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-03-05 18:19:37 +00:00
Kim Altintop e32b00420b set names atomic (#2325)
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Noa <coolreader18@gmail.com>
2025-02-28 21:59:23 +00:00
Noa 27a2afa2b8 Update install script (#2265)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2025-02-21 06:10:31 +00:00
Zeke Foppa 4665c5243c CLI - Add feature to print markdown docs (#2276)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-19 04:33:07 +00:00
Zeke Foppa 5e8eda4869 CI - Fix the SDK Tests CI job after branch rename (#2258)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-14 19:05:30 +00:00
Zeke Foppa 0328a4fe4b CI - Update actions/cache@v2 -> @v4 (#2247)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-12 17:53:41 +00:00
Tyler Cloutier e54a28584a Standardized module names and added module-test-cs based on module-test (#2232) 2025-02-09 05:58:19 +00:00
Noa d4a905d355 Fix CI on master (#2193) 2025-01-30 21:00:03 +00:00
Noa 293aebaef9 Bump to Rust 1.84 (#2001) 2025-01-28 23:11:29 +00:00
Noa e47a8d796f Run smoketests on windows in ci (#2129) 2025-01-16 21:43:38 +00:00