create-syncular-app 0.15.48 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-syncular-app",
3
- "version": "0.15.48",
3
+ "version": "0.16.1",
4
4
  "author": "Benjamin Kniffler",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  // Generated by @syncular/typegen — DO NOT EDIT.
2
2
  // irVersion: 1
3
- // irHash: sha256:7c07edc88f5e6f4b6da196da47e08abe4c7cb304d257a429da6950024f02fa85
3
+ // irHash: sha256:bc1a58e1aae968ebc7be7981d2bcc5f01f176719afab10e6b5b02f4bf1d2ec86
4
4
 
5
5
  export type SyqlRuntimeErrorCode =
6
6
  | 'SYQL_RUNTIME_MISSING_REQUIRED_INPUT'
@@ -65,6 +65,11 @@ export interface QueryClient {
65
65
  * `@syncular/react`'s `useQuery`. `Row` is the projection row
66
66
  * type; `Params` is `undefined` for a param-less query. `sqlFor`
67
67
  * selects a checked revision-1 SYQL physical statement when needed. */
68
+ export interface QueryRelationPlan {
69
+ readonly sql: string;
70
+ readonly relations: readonly { readonly table: string; readonly start: number; readonly end: number; readonly alias?: string }[];
71
+ }
72
+
68
73
  export interface NamedQuery<Row, Params = undefined> {
69
74
  readonly id: string;
70
75
  readonly hasParams: boolean;
@@ -72,6 +77,7 @@ export interface NamedQuery<Row, Params = undefined> {
72
77
  readonly mapRow: (row: Readonly<Record<string, unknown>>) => Row;
73
78
  readonly tables: readonly string[];
74
79
  readonly resultColumns: readonly QueryResultColumn[];
80
+ readonly relationPlans: readonly QueryRelationPlan[];
75
81
  readonly bind: (params: Params) => readonly QueryValue[];
76
82
  readonly sqlFor?: (params: Params) => string;
77
83
  readonly dependencies: (params: Params) => readonly QueryDependency[];
@@ -139,8 +145,8 @@ function listTodosValidate(raw?: ListTodosParams): ListTodosParams {
139
145
  /** Tables 'listTodos' reads (compatibility/export surface). */
140
146
  export const listTodosTables = ['todos'] as const;
141
147
 
142
- const listTodosStatements: { sql: string; bind: (params: ListTodosParams) => QueryValue[] }[] = [
143
- { sql: 'select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos where todos.list_id = ? order by position, id', bind: (params) => [params.listId] },
148
+ const listTodosStatements: (QueryRelationPlan & { bind: (params: ListTodosParams) => QueryValue[] })[] = [
149
+ { sql: 'select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos where todos.list_id = ? order by position, id', relations: [{"table":"todos","start":87,"end":92}], bind: (params) => [params.listId] },
144
150
  ];
145
151
  function listTodosSelect(raw: ListTodosParams): { sql: string; bind: QueryValue[] } {
146
152
  const params = listTodosValidate(raw);
@@ -159,12 +165,13 @@ export async function listTodos(client: QueryClient, params: ListTodosParams): P
159
165
 
160
166
  /** Revisioned reactive descriptor for `useQuery(listTodosQuery, params)`. */
161
167
  export const listTodosQuery: NamedQuery<ListTodosRow, ListTodosParams> = {
162
- id: 'sha256:7c07edc88f5e6f4b6da196da47e08abe4c7cb304d257a429da6950024f02fa85/listTodos',
168
+ id: 'sha256:bc1a58e1aae968ebc7be7981d2bcc5f01f176719afab10e6b5b02f4bf1d2ec86/listTodos',
163
169
  hasParams: true,
164
170
  sql: 'select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos where todos.list_id = ? order by position, id',
165
171
  mapRow: listTodosMapRow,
166
172
  sqlFor: (params: ListTodosParams) => listTodosSelect(params).sql,
167
173
  tables: listTodosTables,
174
+ relationPlans: listTodosStatements,
168
175
  resultColumns: [{ name: 'id', type: 'string', nullable: false }, { name: 'listId', type: 'string', nullable: false }, { name: 'title', type: 'string', nullable: false }, { name: 'done', type: 'boolean', nullable: false }, { name: 'position', type: 'integer', nullable: false }, { name: 'updatedAtMs', type: 'integer', nullable: false }],
169
176
  dependencies: (params) => [
170
177
  { table: 'todos', scopeKeys: ['list:' + String(params.listId) + ''] },
@@ -21,7 +21,7 @@ tauri = { version = "2", features = [] }
21
21
  # The syncular plugin from crates.io. `native-transport` gives the core its
22
22
  # real HTTP + WebSocket transport (ureq + tungstenite) inside the host
23
23
  # process — the webview never talks to the sync server directly.
24
- tauri-plugin-syncular = { version = "0.15.48", features = ["native-transport"] }
24
+ tauri-plugin-syncular = { version = "0.16.1", features = ["native-transport"] }
25
25
 
26
26
  [features]
27
27
  default = []
@@ -1,5 +1,5 @@
1
1
  {
2
- "queryIrVersion": 3,
2
+ "queryIrVersion": 4,
3
3
  "queries": [
4
4
  {
5
5
  "name": "listTodos",
@@ -7,6 +7,13 @@
7
7
  "sourceSql": "select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos\n where todos.list_id = :listId\n order by position, id",
8
8
  "sql": "select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos\n where todos.list_id = :listId\n order by position, id",
9
9
  "positionalSql": "select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos where todos.list_id = ? order by position, id",
10
+ "relations": [
11
+ {
12
+ "table": "todos",
13
+ "start": 87,
14
+ "end": 92
15
+ }
16
+ ],
10
17
  "params": [
11
18
  {
12
19
  "name": "listId",
@@ -126,6 +133,13 @@
126
133
  "activationMask": 0,
127
134
  "sql": "select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos\n where todos.list_id = :listId\n order by position, id",
128
135
  "positionalSql": "select id, list_id AS listId, title, done, position, updated_at_ms AS updatedAtMs from todos where todos.list_id = ? order by position, id",
136
+ "relations": [
137
+ {
138
+ "table": "todos",
139
+ "start": 87,
140
+ "end": 92
141
+ }
142
+ ],
129
143
  "binds": [
130
144
  {
131
145
  "kind": "value",