Repository navigation
feat: Add database scope for table-backed models - #4915
Closed
marcelomendoncasoares with Copilot wants to merge 2 commits into
Closed
marcelomendoncasoares with Copilot wants to merge 2 commits into
marcelomendoncasoares with Copilot wants to merge 2 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Copilot stopped work on behalf of
marcelomendoncasoares due to an error
April 2, 2026 03:08
This comment was marked as resolved.
This comment was marked as resolved.
Agent-Logs-Url: https://github.com/serverpod/serverpod/sessions/814dd702-69f3-4cf8-9565-a1a664221cee Co-authored-by: marcelomendoncasoares <[email protected]>
Contributor
Author
Addressed in 2fa4dbe. The change now adds class-level |
Copilot
AI
changed the title
[WIP] Add database keyword to specify table location for models
feat: Add database scope for table-backed models
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds class-level
databasesupport for table-backed models so repositories and table helpers can be generated for the server, the client, or both.This PR implements the issue to allow specifying client-side tables on models by:
database: server,database: client, anddatabase: allon models withtabledatabaseis omitted by generating database code only on the serverserverpod_databasefor models targeting the clientdatabase: clienttables from server migration definitionsbtreeindexesDatabaseSerializationManagerwhile keeping a deprecated compatibility alias forSerializationManagerServerTargeted analyzer and generator tests were added and updated to cover parsing, validation, server/client generation, and protocol behavior.
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
No breaking changes are intended.
SerializationManagerServernow has the agnostic nameDatabaseSerializationManager, and a deprecated type alias is kept for backwards compatibility.