Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving object defs to SATS #460

Merged
merged 6 commits into from
Nov 13, 2023
Merged

Moving object defs to SATS #460

merged 6 commits into from
Nov 13, 2023

Conversation

mamcx
Copy link
Contributor

@mamcx mamcx commented Oct 24, 2023

Description of Changes

Split the move of DB definitions from #439 in a smaller change set.

This is part of the larger #267. The move into SATS is because cyclic dependencies between db <-> sats <-> vm <-> lib <-> bindings, where we have the need to communicate information across the layers, in concret with the large PR, about the definitions of database objects. For example, we need this in the query layer where TableDef hold our metadata and both vm <-> core need it.

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

Some bindings internal types (and elsewhere) are moved to sats

Expected complexity level and risk

2

@mamcx mamcx requested review from Centril and kim October 24, 2023 20:08
@mamcx mamcx marked this pull request as ready for review October 24, 2023 20:08
Copy link
Contributor

@kim kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the motivation for moving all those types into sats is some cyclic dependency issue, but I'm not able to see where it arises.

Arguably, it's quite strange to expand the scope of sats in this way. Maybe there is a better way to organize the crates, or maybe the solution is not so obvious. I would at least request to explain clearly in the PR description what the problem is and how it is solved. This way, git blame should give some context.

I'd like @Centril to weigh in as well if we should try to find a nicer layout now, or merge this and revisit later.

@mamcx
Copy link
Contributor Author

mamcx commented Oct 26, 2023

I suppose the motivation for moving all those types into sats is some cyclic dependency issue, but I'm not able to see where it arises.

Yes. I updated the pr with a comment. I think trying to put it in a different place is not the best use of energy now, this set of PR is already late, and we have also an incoming refactor for the datastore and in special query engine where we could hit deps problems (I already getting this almost each time I rebase).

When we have the functionality in set we could revisit how to reduce/change the location of things, especially when we have a firm grasp on these incoming refactors.

In concrete, the query engine will need more metadata about the DB, and also the bindings-* crates where is likely AFAIK that we need to move ast objects there, including metadata. Even if is not the case, I don't see how foresee this changes now.

@mamcx mamcx self-assigned this Nov 8, 2023
@mamcx mamcx force-pushed the mamcx/system_tables_newtype branch from c2e8b02 to 3162e3a Compare November 10, 2023 16:55
@mamcx mamcx added the abi-break A PR that makes an ABI breaking change label Nov 10, 2023
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; I made some minor changes during my review:

  1. ColumnIndexAttribute was moved into spacetimedb_primitives which crates bindings-* can use so now we don't need #[path] hackery.
  2. ProductValue takes usize again in the various field methods. I reverted your change here because product values need not be a row and so their fields need not be columns. Perhaps with more neutral language we could use a newtype here in the future.
  3. Some minor refactoring opportunities I saw in your diff.

@Centril Centril enabled auto-merge (squash) November 13, 2023 12:07
@Centril Centril merged commit f12a238 into master Nov 13, 2023
cloutiertyler added a commit that referenced this pull request Nov 14, 2023
Centril pushed a commit that referenced this pull request Nov 14, 2023
* Fixes client API breaks introduced by #460

* lints
@kulakowski
Copy link
Contributor

We'd discussed the spelling of "BTree" and "Hash" vs "btree" and "hash". I thought we had agreed on the latter, but it looks like the former made it in.

@Centril
Copy link
Contributor

Centril commented Nov 14, 2023

We'd discussed the spelling of "BTree" and "Hash" vs "btree" and "hash". I thought we had agreed on the latter, but it looks like the former made it in.

Ah crap; I thought I had that part removed but must have been a bad rebase on that bit.
The spelling should now be irrelevant as the impl should be unused and removable.

@Centril
Copy link
Contributor

Centril commented Nov 14, 2023

Removed in #559.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break A PR that makes an ABI breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants