Skip to content

Expose a method to create a DatabaseSession on the client #4792

Closed

Description

@marcelomendoncasoares

Once the repository methods are generated on the client (#4791), a DatabaseSession will be needed to interact with them - following the same pattern as on the server.

For this, a new createSession method could be generated on the Client class to be used as:

final session = client.createSession();
final models = await Model.db.find(session);

Differently from the server, it would be a single session for the lifetime of the application (passed around using providers). This is similar to the experience with other packages that provide a local database, with the difference that usually it is the database that is passed around.

The createSession method would be generated only if at least one client-side table is declared on the models.

Metadata

Metadata

Labels

area: clientarea: databaseenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions