| undefined` - Filter applied after any aggregations (group by).
-#### Return type
-`GetUpdateReturnType | undefined`
-
-## updateBatch()
-Updates multiple records in the table in a batch operation.
-- Each item in the `data` array contains a filter and the corresponding data to update.
-```typescript
- updateBatch: (data: [FullFilter, Partial>][], params?: SelectParams): Promise>
- ```
-#### Arguments
-
- - **data**: `[FullFilter, Partial>][]`
- - **params**: `SelectParams`
- - **limit**: `number | null | undefined` - Max number of rows to return. - If undefined then 1000 will be applied as the default. - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present).
- - **offset**: `number` - Number of rows to skip.
- - **groupBy**: `false` - Will group by all non aggregated fields specified in select (or all fields by default).
- - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined` - Result data structure/type:. - row: the first row as an object. - value: the first value from of first field. - values: array of values from the selected field. - statement: sql statement. - statement-no-rls: sql statement without row level security. - statement-where: sql statement where condition.
- - **select**: `Select` - Fields/expressions/linked data to select. - If empty then all fields will be selected. - If "*" then all fields will be selected. - If { field: 0 } then all fields except the specified field will be selected. - If { field: 1 } then only the specified field will be selected. - If { field: { funcName: [args] } } then the field will be selected with the specified function applied. - If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields.
- - **orderBy**: `OrderBy` - Order by options. - If array then the order will be maintained.
- - **having**: `FullFilter | undefined` - Filter applied after any aggregations (group by).
-#### Return type
-`void | GetUpdateReturnType`
-
-## insert()
-Inserts a new record into the table.
-```typescript
- insert: (data: UpsertDataToPGCast | UpsertDataToPGCast[], params?: SelectParams): Promise>
- ```
-#### Arguments
-
- - **data**: `InsertData`
- - **params**: `SelectParams`
- - **limit**: `number | null | undefined` - Max number of rows to return. - If undefined then 1000 will be applied as the default. - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present).
- - **offset**: `number` - Number of rows to skip.
- - **groupBy**: `false` - Will group by all non aggregated fields specified in select (or all fields by default).
- - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined` - Result data structure/type:. - row: the first row as an object. - value: the first value from of first field. - values: array of values from the selected field. - statement: sql statement. - statement-no-rls: sql statement without row level security. - statement-where: sql statement where condition.
- - **select**: `Select` - Fields/expressions/linked data to select. - If empty then all fields will be selected. - If "*" then all fields will be selected. - If { field: 0 } then all fields except the specified field will be selected. - If { field: 1 } then only the specified field will be selected. - If { field: { funcName: [args] } } then the field will be selected with the specified function applied. - If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields.
- - **orderBy**: `OrderBy` - Order by options. - If array then the order will be maintained.
- - **having**: `FullFilter | undefined` - Filter applied after any aggregations (group by).
-#### Return type
-`GetInsertReturnType`
-
-## upsert()
-Inserts or updates a record in the table.
-- If a record matching the `filter` exists, it updates the record.
-- If no matching record exists, it inserts a new record.
-```typescript
- upsert: (filter: FullFilter, newData: Partial, params?: SelectParams): Promise | undefined>
- ```
-#### Arguments
-
- - **filter**: `FullFilter` - Group or simple filter.
- - **newData**: `Partial` - Make all properties in T optional.
-
- - **params**: `SelectParams`
- - **limit**: `number | null | undefined` - Max number of rows to return. - If undefined then 1000 will be applied as the default. - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present).
- - **offset**: `number` - Number of rows to skip.
- - **groupBy**: `false` - Will group by all non aggregated fields specified in select (or all fields by default).
- - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined` - Result data structure/type:. - row: the first row as an object. - value: the first value from of first field. - values: array of values from the selected field. - statement: sql statement. - statement-no-rls: sql statement without row level security. - statement-where: sql statement where condition.
- - **select**: `Select` - Fields/expressions/linked data to select. - If empty then all fields will be selected. - If "*" then all fields will be selected. - If { field: 0 } then all fields except the specified field will be selected. - If { field: 1 } then only the specified field will be selected. - If { field: { funcName: [args] } } then the field will be selected with the specified function applied. - If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields.
- - **orderBy**: `OrderBy` - Order by options. - If array then the order will be maintained.
- - **having**: `FullFilter | undefined` - Filter applied after any aggregations (group by).
-#### Return type
-`GetUpdateReturnType | undefined`
-
-## delete()
-Deletes records from the table based on the specified filter criteria.
-- If no filter is provided, all records may be deleted (use with caution).
-```typescript
- delete: (filter?: FullFilter | undefined, params?: SelectParams): Promise | undefined>
- ```
-#### Arguments
-
- - **filter**: `FullFilter | undefined`
- - **params**: `SelectParams`
- - **limit**: `number | null | undefined` - Max number of rows to return. - If undefined then 1000 will be applied as the default. - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present).
- - **offset**: `number` - Number of rows to skip.
- - **groupBy**: `false` - Will group by all non aggregated fields specified in select (or all fields by default).
- - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined` - Result data structure/type:. - row: the first row as an object. - value: the first value from of first field. - values: array of values from the selected field. - statement: sql statement. - statement-no-rls: sql statement without row level security. - statement-where: sql statement where condition.
- - **select**: `Select` - Fields/expressions/linked data to select. - If empty then all fields will be selected. - If "*" then all fields will be selected. - If { field: 0 } then all fields except the specified field will be selected. - If { field: 1 } then only the specified field will be selected. - If { field: { funcName: [args] } } then the field will be selected with the specified function applied. - If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields.
- - **orderBy**: `OrderBy` - Order by options. - If array then the order will be maintained.
- - **having**: `FullFilter | undefined` - Filter applied after any aggregations (group by).
-#### Return type
-`GetUpdateReturnType | undefined`
\ No newline at end of file
diff --git a/documentation/METHODS.md b/documentation/METHODS.md
new file mode 100644
index 00000000..aebc3509
--- /dev/null
+++ b/documentation/METHODS.md
@@ -0,0 +1,1467 @@
+# Isomorphic Methods
+
+The following methods are available on the client and server.
+
+## getInfo(lang?: string): Promise<TableInfo>
+Retrieves the table/view info
+```typescript
+getInfo: ():
+```
+#### Parameters
+
+ - **lang**: `string`
+
+ Language code for i18n data. "en" by default
+#### `TableInfo`
+
+
+ - **oid**: `number`
+
+ OID from the postgres database
+ Useful in handling renamed tables
+ - **comment**: `string`
+
+ Comment from the postgres database
+ - **isFileTable**: `FileTableConfig`
+
+ Defined if this is the fileTable
+ - **allowedNestedInserts**: `{ table: string; column: string; }`
+
+
+ - **table**: `string`
+
+
+ - **column**: `string`
+
+
+ - **hasFiles**: `false`
+
+ True if fileTable is enabled and this table references the fileTable
+ Used in UI
+ - **isView**: `false`
+
+ True if this is a view.
+ Table methods (insert, update, delete) are undefined for views
+ - **fileTableName**: `string`
+
+ Name of the fileTable (if enabled)
+ Used in UI
+ - **dynamicRules**: `{ update?: boolean | undefined; }`
+
+ Used for getColumns in cases where the columns are dynamic based on the request.
+ See dynamicFields from Update rules
+ - **update**: `false`
+
+
+ - **info**: `{ label?: string | undefined; }`
+
+ Additional table info provided through TableConfig
+ - **label**: `string`
+
+
+ - **uniqueColumnGroups**: `string[][] | undefined`
+
+ List of unique column indexes/constraints.
+ Column groups where at least a column is not allowed to be viewed (selected) are omitted.
+
+## getColumns(lang?: string, params?: GetColumnsParams): Promise<ValidatedColumnInfo[]>
+Retrieves columns metadata of the table/view
+```typescript
+getColumns: ():
+```
+#### Parameters
+
+ - **lang**: `string`
+
+
+ - **params**: `GetColumnsParams`
+
+ Dynamic/filter based rules allow limit what columns can be updated based on the request data/filter
+ This allows parameter allows identifying the columns that can be updated based on the request data
+ - **rule**: `"update"`
+
+
+ - **data**: `AnyObject`
+
+
+
+ - **filter**: `FullFilter`
+
+ Data filter
+ - `{ status: 'live' }`
+ - `{ $or: [{ id: 1 }, { status: 'live' }] }`
+ - `{ $existsJoined: { referencedTable: { id: 1 } } }`
+ - `{
+ $filter: [
+ { $age: ["created_at"] },
+ "<",
+ '1 year'
+ ]
+ }`
+#### `ValidatedColumnInfo`
+
+
+ - **name**: `string`
+
+
+ - **label**: `string`
+
+ Column display name. Will be first non empty value from i18n data, comment, name
+ - **comment**: `string | undefined`
+
+ Column description (if provided)
+ - **ordinal_position**: `number`
+
+ Ordinal position of the column within the table (count starts at 1)
+ - **is_nullable**: `boolean`
+
+ True if column is nullable
+ - **is_updatable**: `boolean`
+
+
+ - **is_generated**: `boolean`
+
+ If the column is a generated column (converted to boolean from ALWAYS and NEVER)
+ - **data_type**: `string`
+
+ Simplified data type
+ - **udt_name**: `PG_COLUMN_UDT_DATA_TYPE`
+
+ Postgres data type name.
+ Array types start with an underscore
+ - **element_type**: `string | undefined`
+
+ Element data type
+ - **element_udt_name**: `string | undefined`
+
+ Element data type name
+ - **is_pkey**: `boolean`
+
+ PRIMARY KEY constraint on column.
+ A table can have a multi column primary key
+ - **references**: `ReferenceTable`
+
+
+ - **ftable**: `string`
+
+
+ - **fcols**: `string`
+
+
+ - **cols**: `string`
+
+
+ - **has_default**: `boolean`
+
+ true if column has a default value
+ Used for excluding pkey from insert
+ - **column_default**: `any`
+
+ Column default value
+ - **min**: `string | number | undefined`
+
+ Extracted from tableConfig
+ Used in SmartForm
+ - **max**: `string | number | undefined`
+
+
+ - **hint**: `string`
+
+
+ - **jsonbSchema**: `JSONBSchema`
+
+ JSONB schema (a simplified version of json schema) for the column (if defined in the tableConfig)
+ A check constraint will use this schema for runtime data validation and apropriate TS types will be generated
+ - **nullable**: `any`
+
+ False by default
+ - **description**: `any`
+
+
+ - **title**: `any`
+
+
+ - **type**: `any`
+
+
+ - **allowedValues**: `any`
+
+
+ - **oneOf**: `any`
+
+
+ - **oneOfType**: `any`
+
+
+ - **arrayOf**: `any`
+
+
+ - **arrayOfType**: `any`
+
+
+ - **enum**: `any`
+
+
+ - **record**: `any`
+
+
+ - **lookup**: `any`
+
+
+ - **defaultValue**: `any`
+
+
+ - **file**: `FileColumnConfig | undefined`
+
+ If degined then this column is referencing the file table
+ Extracted from FileTable config
+ Used in SmartForm
+ - **tsDataType**: `"string" | "number" | "boolean" | "any" | "number[]" | "boolean[]" | "string[]" | "any[]"`
+
+ TypeScript data type
+ - **select**: `boolean`
+
+ Can be viewed/selected
+ Based on access rules and postgres policies
+ - **orderBy**: `boolean`
+
+ Can be ordered by
+ Based on access rules
+ - **filter**: `boolean`
+
+ Can be filtered by
+ Based on access rules
+ - **insert**: `boolean`
+
+ Can be inserted
+ Based on access rules and postgres policies
+ - **update**: `boolean`
+
+ Can be updated
+ Based on access rules and postgres policies
+ - **delete**: `boolean`
+
+ Can be used in the delete filter
+ Based on access rules
+
+## find(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): Promise<GetSelectReturnType<S, P, T, true>>
+Retrieves a list of matching records from the view/table
+```typescript
+find: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+ Filter to apply. Undefined will return all records
+ - { "field": "value" }
+ - { "field": { $in: ["value", "value2"] } }
+ - { $or: [
+ { "field1": "value" },
+ { "field2": "value" }
+ ]
+ }
+ - { $existsJoined: { linkedTable: { "linkedTableField": "value" } } }
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `GetSelectReturnType`
+
+
+
+## findOne(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): Promise<GetSelectReturnType<S, P, T, false> | undefined>
+Retrieves a record from the view/table
+```typescript
+findOne: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `GetSelectReturnType | undefined`
+
+
+
+## subscribe(filter: ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, params: SelectParams, onData: SubscribeCallback, onError?: SubscribeOnError): Promise<SubscriptionHandler>
+Retrieves a list of matching records from the view/table and subscribes to changes
+```typescript
+subscribe: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter`
+
+ Data filter
+ - `{ status: 'live' }`
+ - `{ $or: [{ id: 1 }, { status: 'live' }] }`
+ - `{ $existsJoined: { referencedTable: { id: 1 } } }`
+ - `{
+ $filter: [
+ { $age: ["created_at"] },
+ "<",
+ '1 year'
+ ]
+ }`
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+ - **onData**: `SubscribeCallback`
+
+ Callback fired once after subscribing and then every time the data matching the filter changes
+ - **onError**: `SubscribeOnError`
+
+ Error handler that may fire due to schema changes or other post subscribe issues
+ Column or filter issues are thrown during the subscribe call
+#### `SubscriptionHandler`
+
+
+ - **unsubscribe**: `() => Promise`
+
+
+ - **filter**: `{} | FullFilter`
+
+
+
+## subscribeOne(filter: ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, params: SelectParams, onData: SubscribeOneCallback, onError?: SubscribeOnError): Promise<SubscriptionHandler>
+Retrieves first matching record from the view/table and subscribes to changes
+```typescript
+subscribeOne: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter`
+
+ Data filter
+ - `{ status: 'live' }`
+ - `{ $or: [{ id: 1 }, { status: 'live' }] }`
+ - `{ $existsJoined: { referencedTable: { id: 1 } } }`
+ - `{
+ $filter: [
+ { $age: ["created_at"] },
+ "<",
+ '1 year'
+ ]
+ }`
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+ - **onData**: `SubscribeOneCallback`
+
+ Callback fired once after subscribing and then every time the data matching the filter changes
+ - **onError**: `SubscribeOnError`
+
+ Error handler that may fire due to schema changes or other post subscribe issues
+ Column or filter issues are thrown during the subscribe call
+#### `SubscriptionHandler`
+
+
+ - **unsubscribe**: `() => Promise`
+
+
+ - **filter**: `{} | FullFilter`
+
+
+
+## count(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): Promise<number>
+Returns the number of rows that match the filter
+```typescript
+count: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `number`
+
+
+
+## size(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): Promise<string>
+Returns result size in bits
+```typescript
+size: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `string`
+
+
+
+## update(filter: ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, newData: Partial, params?: SelectParams): Promise<GetUpdateReturnType<P, T, S> | undefined>
+Updates a record in the table based on the specified filter criteria
+- Use { multi: false } to ensure no more than one row is updated
+```typescript
+update: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter`
+
+ Data filter
+ - `{ status: 'live' }`
+ - `{ $or: [{ id: 1 }, { status: 'live' }] }`
+ - `{ $existsJoined: { referencedTable: { id: 1 } } }`
+ - `{
+ $filter: [
+ { $age: ["created_at"] },
+ "<",
+ '1 year'
+ ]
+ }`
+ - **newData**: `Partial`
+
+ Make all properties in T optional
+
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `GetUpdateReturnType | undefined`
+
+
+
+## updateBatch(data: [FullFilter, Partial>][], params?: SelectParams): Promise<void | GetUpdateReturnType<P, T, S>>
+Updates multiple records in the table in a batch operation.
+- Each item in the `data` array contains a filter and the corresponding data to update.
+```typescript
+updateBatch: ():
+```
+#### Parameters
+
+ - **data**: `[FullFilter, Partial>][]`
+
+
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `void | GetUpdateReturnType`
+
+
+
+## insert(data: UpsertDataToPGCast | UpsertDataToPGCast[], params?: SelectParams): Promise<GetInsertReturnType<D, P, T, S>>
+Inserts a new record into the table.
+```typescript
+insert: ():
+```
+#### Parameters
+
+ - **data**: `InsertData`
+
+
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `GetInsertReturnType`
+
+
+
+## upsert(filter: ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, newData: Partial, params?: SelectParams): Promise<GetUpdateReturnType<P, T, S> | undefined>
+Inserts or updates a record in the table.
+- If a record matching the `filter` exists, it updates the record.
+- If no matching record exists, it inserts a new record.
+```typescript
+upsert: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter`
+
+ Data filter
+ - `{ status: 'live' }`
+ - `{ $or: [{ id: 1 }, { status: 'live' }] }`
+ - `{ $existsJoined: { referencedTable: { id: 1 } } }`
+ - `{
+ $filter: [
+ { $age: ["created_at"] },
+ "<",
+ '1 year'
+ ]
+ }`
+ - **newData**: `Partial`
+
+ Make all properties in T optional
+
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `GetUpdateReturnType | undefined`
+
+
+
+## delete(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, params?: SelectParams): Promise<GetUpdateReturnType<P, T, S> | undefined>
+Deletes records from the table based on the specified filter criteria.
+- If no filter is provided, all records may be deleted (use with caution).
+```typescript
+delete: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **params**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `GetUpdateReturnType | undefined`
+
+
+# Client Methods
+
+The following methods are available on the client.
+
+## getJoinedTables(): string[]
+
+```typescript
+getJoinedTables: ():
+```
+#### Parameters
+
+#### `string`
+
+
+
+
+
+
+
+## sync(basicFilter: EqualityFilter, options: SyncOptions, onChange: (data: SyncDataItem, false>[], delta?: Partial[] | undefined) => any, onError?: (error: any) => void): Promise<{ $unsync: () => void; $upsert: (newData: T[]) => any; getItems: () => T[]; }>
+
+```typescript
+sync: ():
+```
+#### Parameters
+
+ - **basicFilter**: `EqualityFilter`
+
+ Equality filter used for sync
+ Multiple columns are combined with AND
+
+ - **options**: `SyncOptions`
+
+
+ - **onChange**: `(data: SyncDataItem, false>[], delta?: Partial[] | undefined) => any`
+
+
+ - **onError**: `(error: any) => void`
+
+
+#### `{ $unsync: () => void; $upsert: (newData: T[]) => any; getItems: () => T[]; }`
+
+
+ - **$unsync**: `() => void`
+
+
+ - **$upsert**: `(newData: T[]) => any`
+
+
+ - **getItems**: `() => T[]`
+
+
+
+## useSync(basicFilter: EqualityFilter, syncOptions: SyncOptions): { data: SyncDataItem<Required<T>>[] | undefined; isLoading: boolean; error?: any; }
+Retrieves rows matching the filter and keeps them in sync
+- use { handlesOnData: true } to get optimistic updates method: $update
+- any changes to the row using the $update method will be reflected instantly
+ to all sync subscribers that were initiated with the same syncOptions
+```typescript
+useSync: ():
+```
+#### Parameters
+
+ - **basicFilter**: `EqualityFilter`
+
+ Equality filter used for sync
+ Multiple columns are combined with AND
+
+ - **syncOptions**: `SyncOptions`
+
+
+#### `{ data: SyncDataItem>[] | undefined; isLoading: boolean; error?: any; }`
+
+
+ - **data**: `SyncDataItem>[] | undefined`
+
+
+ - **isLoading**: `boolean`
+
+
+ - **error**: `any`
+
+
+
+## syncOne(basicFilter: Partial, options: SyncOneOptions, onChange: (data: SyncDataItem, false>, delta?: Partial | undefined) => any, onError?: (error: any) => void): Promise<SingleSyncHandles<T, false>>
+
+```typescript
+syncOne: ():
+```
+#### Parameters
+
+ - **basicFilter**: `Partial`
+
+ Make all properties in T optional
+
+ - **options**: `SyncOneOptions`
+
+
+ - **onChange**: `(data: SyncDataItem, false>, delta?: Partial | undefined) => any`
+
+
+ - **onError**: `(error: any) => void`
+
+
+#### `SingleSyncHandles`
+
+ CRUD handles added if initialised with handlesOnData = true
+ - **$get**: `() => T | undefined`
+
+
+ - **$find**: `(idObj: Partial) => T | undefined`
+
+
+ - **$unsync**: `() => any`
+
+
+ - **$delete**: `() => void`
+
+
+ - **$update**: `(newData: OPTS extends { deepMerge: true; } ? DeepPartial : Partial, opts?: OPTS | undefined) => any`
+
+
+ - **$cloneSync**: `CloneSync`
+
+
+ - **$cloneMultiSync**: `CloneMultiSync`
+
+
+
+## useSyncOne(basicFilter: EqualityFilter, syncOptions: SyncOneOptions): { data: SyncDataItem<Required<T>> | undefined; isLoading: boolean; error?: any; }
+Retrieves the first row matching the filter and keeps it in sync
+- use { handlesOnData: true } to get optimistic updates method: $update
+- any changes to the row using the $update method will be reflected instantly
+ to all sync subscribers that were initiated with the same syncOptions
+```typescript
+useSyncOne: ():
+```
+#### Parameters
+
+ - **basicFilter**: `EqualityFilter`
+
+ Equality filter used for sync
+ Multiple columns are combined with AND
+
+ - **syncOptions**: `SyncOneOptions`
+
+
+#### `{ data: SyncDataItem> | undefined; isLoading: boolean; error?: any; }`
+
+
+ - **data**: `SyncDataItem> | undefined`
+
+
+ - **isLoading**: `boolean`
+
+
+ - **error**: `any`
+
+
+
+
+
+## useSubscribe(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, options?: SubscribeParams): { data: GetSelectReturnType<S, SubParams, T, true> | undefined; error?: any; isLoading: boolean; }
+Retrieves a list of matching records from the view/table and subscribes to changes
+```typescript
+useSubscribe: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **options**: `SubscribeParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+ - **throttle**: `number`
+
+ If true then the subscription will be throttled to the provided number of milliseconds
+ - **throttleOpts**: `{ skipFirst?: boolean | undefined; }`
+
+
+ - **skipFirst**: `false`
+
+ False by default.
+ If true then the first value will be emitted at the end of the interval. Instant otherwise
+#### `{ data: GetSelectReturnType | undefined; error?: any; isLoading: boolean; }`
+
+
+ - **data**: `GetSelectReturnType | undefined`
+
+
+ - **error**: `any`
+
+
+ - **isLoading**: `boolean`
+
+
+
+## useSubscribeOne(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, options?: SubscribeParams): { data: GetSelectReturnType<S, SubParams, T, false> | undefined; error?: any; isLoading: boolean; }
+Retrieves a matching record from the view/table and subscribes to changes
+```typescript
+useSubscribeOne: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **options**: `SubscribeParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+ - **throttle**: `number`
+
+ If true then the subscription will be throttled to the provided number of milliseconds
+ - **throttleOpts**: `{ skipFirst?: boolean | undefined; }`
+
+
+ - **skipFirst**: `false`
+
+ False by default.
+ If true then the first value will be emitted at the end of the interval. Instant otherwise
+#### `{ data: GetSelectReturnType | undefined; error?: any; isLoading: boolean; }`
+
+
+ - **data**: `GetSelectReturnType | undefined`
+
+
+ - **error**: `any`
+
+
+ - **isLoading**: `boolean`
+
+
+
+## useFind(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): { data: GetSelectReturnType<S, P, T, true> | undefined; isLoading: boolean; error?: any; }
+Retrieves a list of matching records from the view/table
+```typescript
+useFind: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `{ data: GetSelectReturnType | undefined; isLoading: boolean; error?: any; }`
+
+
+ - **data**: `GetSelectReturnType | undefined`
+
+
+ - **isLoading**: `boolean`
+
+
+ - **error**: `any`
+
+
+
+## useFindOne(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): { data: GetSelectReturnType<S, P, T, false> | undefined; isLoading: boolean; error?: any; }
+Retrieves first matching record from the view/table
+```typescript
+useFindOne: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `{ data: GetSelectReturnType | undefined; isLoading: boolean; error?: any; }`
+
+
+ - **data**: `GetSelectReturnType | undefined`
+
+
+ - **isLoading**: `boolean`
+
+
+ - **error**: `any`
+
+
+
+## useCount(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): { data: number | undefined; isLoading: boolean; error?: any; }
+Returns the total number of rows matching the filter
+```typescript
+useCount: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `{ data: number | undefined; isLoading: boolean; error?: any; }`
+
+
+ - **data**: `number | undefined`
+
+
+ - **isLoading**: `boolean`
+
+
+ - **error**: `any`
+
+
+
+## useSize(filter?: undefined | ComplexFilter | { $and: FullFilter[]; } | { $or: FullFilter[]; } | NormalFilter | ShorthandFilter | Partial, selectParams?: SelectParams): { data: string | undefined; isLoading: boolean; error?: any; }
+Returns result size in bits matching the filter and selectParams
+```typescript
+useSize: ():
+```
+#### Parameters
+
+ - **filter**: `FullFilter | undefined`
+
+
+ - **selectParams**: `SelectParams`
+
+
+ - **limit**: `number | null | undefined`
+
+ Max number of rows to return. Defaults to 1000
+ - On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)
+ - **offset**: `number`
+
+ Number of rows to skip
+ - **groupBy**: `false`
+
+ Will group by all non aggregated fields specified in select (or all fields by default)
+ - **returnType**: `"row" | "value" | "values" | "statement" | "statement-no-rls" | "statement-where" | undefined`
+
+ Result data structure/type:
+ - **row**: the first row as an object
+ - **value**: the first value from of first field
+ - **values**: array of values from the selected field
+ - **statement**: sql statement
+ - **statement-no-rls**: sql statement without row level security
+ - **statement-where**: sql statement where condition
+ - **select**: `Select`
+
+ Fields/expressions/linked data to select
+ - `"*"` or empty will return all fields
+ - `{ field: 0 }` - all fields except the specified field will be selected
+ - `{ field: 1 }` - only the specified field will be selected
+ - `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied
+ - `{ field: 1, referencedTable: "*" }` - field together with all fields from referencedTable will be selected
+ - `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable
+ - **orderBy**: `OrderBy`
+
+ Order by options
+ - Order is maintained in arrays
+ - `[{ key: "field", asc: true, nulls: "last" }]`
+ - **having**: `FullFilter | undefined`
+
+ Filter applied after any aggregations (group by)
+#### `{ data: string | undefined; isLoading: boolean; error?: any; }`
+
+
+ - **data**: `string | undefined`
+
+
+ - **isLoading**: `boolean`
+
+
+ - **error**: `any`
+
diff --git a/documentation/SERVER.md b/documentation/SERVER.md
index 7cf16244..dd123e66 100644
--- a/documentation/SERVER.md
+++ b/documentation/SERVER.md
@@ -11,8 +11,8 @@ To get started, you need to provide a configuration object to the server.
Basic example:
```typescript
import prostgles from "prostgles-server";
-import { DBSchemaGenerated } from "./DBSchemaGenerated";
-prostgles({
+import { DBGeneratedSchema } from "./DBGeneratedSchema";
+prostgles({
dbConnection: {
host: "localhost",
port: 5432,
@@ -37,10 +37,9 @@ prostgles({
- onReady `OnReadyCallback`
Called when the prostgles server is ready to accept connections.
It waits for auth, tableConfig and other async configurations to complete before executing
- - dbOptions `IDefaults`
- tsGeneratedTypesDir `string | undefined`
- If defined then a `DBSchemaGenerated.d.ts` file will be created in the provided directory.
-This file exports a `DBSchemaGenerated` type which contains types for the database tables and
+ If defined then a `DBGeneratedSchema.d.ts` file will be created in the provided directory.
+This file exports a `DBGeneratedSchema` type which contains types for the database tables and
can be used as a generic type input for the prostgles instances to ensure type safety
- disableRealtime `boolean | undefined`
If true then schema watch, subscriptions and syncs will be disabled.
@@ -83,11 +82,11 @@ Supports email and OAuth strategies
Useful for logging or debugging
- watchSchemaType `"DDL_trigger" | "prostgles_queries" | undefined`
- watchSchema `boolean | EventTriggerTagFilter | "hotReloadMode" | OnSchemaChangeCallback | undefined`
- If truthy then DBSchemaGenerated.d.ts will be updated
+ If truthy then DBGeneratedSchema.d.ts will be updated
and "onReady" will be called with new schema on both client and server
- keywords `Keywords`
- onNotice `(notice: AnyObject, message?: string | undefined) => void`
- - fileTable `FileTableConfig`
+ - fileTable `FileTableConfig | undefined`
Enables file storage and serving.
Currently supports saving files locally or to AWS S3
- restApi `RestApiConfig`
diff --git a/documentation/utils/clientTypes.ts b/documentation/utils/clientTypes.ts
index 8bf3da06..1983dcd1 100644
--- a/documentation/utils/clientTypes.ts
+++ b/documentation/utils/clientTypes.ts
@@ -15,7 +15,7 @@ export const definitions = [
"type": "primitive",
"alias": "string",
"subType": "string",
- "comments": "Language code for i18n data\n```typescript\n \"en\"\n```"
+ "comments": "Language code for i18n data. \"en\" by default"
}
],
"returnType": {
@@ -44,7 +44,8 @@ export const definitions = [
},
"isFileTable": {
"type": "object",
- "alias": "{ allowedNestedInserts?: { table: string; column: string; }[] | undefined; }",
+ "alias": "FileTableConfig",
+ "aliasSymbolescapedName": "FileTableConfig",
"comments": "Defined if this is the fileTable",
"properties": {
"allowedNestedInserts": {
@@ -79,20 +80,21 @@ export const definitions = [
"alias": "false",
"subType": "boolean",
"optional": true,
- "comments": "True if fileTable is enabled and this table references the fileTable"
+ "comments": "True if fileTable is enabled and this table references the fileTable\nUsed in UI"
},
"isView": {
"type": "primitive",
"alias": "false",
"subType": "boolean",
- "optional": true
+ "optional": true,
+ "comments": "True if this is a view.\nTable methods (insert, update, delete) are undefined for views"
},
"fileTableName": {
"type": "primitive",
"alias": "string",
"subType": "string",
"optional": true,
- "comments": "Name of the fileTable (if enabled)"
+ "comments": "Name of the fileTable (if enabled)\nUsed in UI"
},
"dynamicRules": {
"type": "object",
@@ -152,7 +154,8 @@ export const definitions = [
}
},
"optional": false,
- "comments": "Retrieves the table/view info"
+ "comments": "Retrieves the table/view info",
+ "intersectionParent": "ViewHandler"
},
"getColumns": {
"type": "function",
@@ -189,10 +192,145 @@ export const definitions = [
"optional": false
},
"filter": {
- "type": "object",
- "alias": "AnyObject",
- "aliasSymbolescapedName": "AnyObject",
- "properties": {},
+ "type": "union",
+ "alias": "FullFilter",
+ "aliasSymbolescapedName": "FullFilter",
+ "comments": "Data filter\n- `{ status: 'live' }`\n- `{ $or: [{ id: 1 }, { status: 'live' }] }`\n- `{ $existsJoined: { referencedTable: { id: 1 } } }`\n- `{\n $filter: [\n { $age: [\"created_at\"] },\n \"<\",\n '1 year'\n ]\n }`",
+ "types": [
+ {
+ "type": "object",
+ "alias": "ComplexFilter",
+ "aliasSymbolescapedName": "ComplexFilter",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "{ $and: FullFilter[]; }",
+ "properties": {
+ "$and": {
+ "type": "array",
+ "alias": "FullFilter[]",
+ "itemType": {
+ "type": "reference",
+ "alias": "FullFilter",
+ "aliasSymbolescapedName": "FullFilter",
+ "comments": "Data filter\n- `{ status: 'live' }`\n- `{ $or: [{ id: 1 }, { status: 'live' }] }`\n- `{ $existsJoined: { referencedTable: { id: 1 } } }`\n- `{\n $filter: [\n { $age: [\"created_at\"] },\n \"<\",\n '1 year'\n ]\n }`"
+ },
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "{ $or: FullFilter[]; }",
+ "properties": {
+ "$or": {
+ "type": "array",
+ "alias": "FullFilter[]",
+ "itemType": {
+ "type": "reference",
+ "alias": "FullFilter",
+ "aliasSymbolescapedName": "FullFilter",
+ "comments": "Data filter\n- `{ status: 'live' }`\n- `{ $or: [{ id: 1 }, { status: 'live' }] }`\n- `{ $existsJoined: { referencedTable: { id: 1 } } }`\n- `{\n $filter: [\n { $age: [\"created_at\"] },\n \"<\",\n '1 year'\n ]\n }`"
+ },
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "NormalFilter",
+ "aliasSymbolescapedName": "NormalFilter",
+ "comments": "Column filter with operators\nMultiple columns are combined with AND",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true,
+ "intersectionParent": "Partial"
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ [x: `${string}.=`]: any; [x: `${string}.$eq`]: any; [x: `${string}.<>`]: any; [x: `${string}.>`]: any; [x: `${string}.<`]: any; [x: `${string}.>=`]: any; [x: `${string}.<=`]: any; [x: `${string}.$ne`]: any; [x: `${string}.$gt`]: any; [x: `${string}.$gte`]: any; [x: `${string}.$lt`]: any; [x: `${string}.$lt...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {}
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }>",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {}
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ [x: `${string}.=`]: any; [x: `${string}.$eq`]: any; [x: `${string}.<>`]: any; [x: `${string}.>`]: any; [x: `${string}.<`]: any; [x: `${string}.>=`]: any; [x: `${string}.<=`]: any; [x: `${string}.$ne`]: any; [x: `${string}.$gt`]: any; [x: `${string}.$gte`]: any; [x: `${string}.$lt`]: any; [x: `${string}.$lt...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {}
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ [x: `${string}.=`]: any; [x: `${string}.$eq`]: any; [x: `${string}.<>`]: any; [x: `${string}.>`]: any; [x: `${string}.<`]: any; [x: `${string}.>=`]: any; [x: `${string}.<=`]: any; [x: `${string}.$ne`]: any; [x: `${string}.$gt`]: any; [x: `${string}.$gte`]: any; [x: `${string}.$lt`]: any; [x: `${string}.$lt...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {}
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }> & Partial<{ [x: `${string}.$ilike`]: any; [x: `${string}.$like`]: any; [x: `${string}.$nilike`]: any; [x: `${string}.$nlike`]: any; }>",
+ "properties": {}
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }> & Partial<{ [x: `${string}.@@`]: any; [x: `${string}.@>`]: any; [x: `${string}.<@`]: any; [x: `${string}.$contains`]: any; [x: `${string}.$containedBy`]: any; }>",
+ "properties": {}
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ $exists: any; $notExists: any; $existsJoined: any; $notExistsJoined: any; }>",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {
+ "$exists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$existsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExistsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ }
+ }
+ }
+ ],
"optional": false
}
}
@@ -214,28 +352,43 @@ export const definitions = [
"type": "primitive",
"alias": "string",
"subType": "string",
- "optional": false
+ "optional": false,
+ "intersectionParent": "ColumnInfo"
},
"label": {
"type": "primitive",
"alias": "string",
"subType": "string",
"optional": false,
- "comments": "Column display name. Will be first non empty value from i18n data, comment, name"
+ "comments": "Column display name. Will be first non empty value from i18n data, comment, name",
+ "intersectionParent": "ColumnInfo"
},
"comment": {
- "type": "primitive",
- "alias": "string",
- "subType": "string",
+ "type": "union",
+ "alias": "string | undefined",
+ "types": [
+ {
+ "type": "primitive",
+ "alias": "undefined",
+ "subType": "undefined"
+ },
+ {
+ "type": "primitive",
+ "alias": "string",
+ "subType": "string"
+ }
+ ],
"optional": false,
- "comments": "Column description (if provided)"
+ "comments": "Column description (if provided)",
+ "intersectionParent": "ColumnInfo"
},
"ordinal_position": {
"type": "primitive",
"alias": "number",
"subType": "number",
"optional": false,
- "comments": "Ordinal position of the column within the table (count starts at 1)"
+ "comments": "Ordinal position of the column within the table (count starts at 1)",
+ "intersectionParent": "ColumnInfo"
},
"is_nullable": {
"type": "union",
@@ -248,7 +401,8 @@ export const definitions = [
}
],
"optional": false,
- "comments": "True if column is nullable. A not-null constraint is one way a column can be known not nullable, but there may be others."
+ "comments": "True if column is nullable",
+ "intersectionParent": "ColumnInfo"
},
"is_updatable": {
"type": "union",
@@ -260,7 +414,8 @@ export const definitions = [
"subType": "boolean"
}
],
- "optional": false
+ "optional": false,
+ "intersectionParent": "ColumnInfo"
},
"is_generated": {
"type": "union",
@@ -273,35 +428,62 @@ export const definitions = [
}
],
"optional": false,
- "comments": "If the column is a generated column (converted to boolean from ALWAYS and NEVER)"
+ "comments": "If the column is a generated column (converted to boolean from ALWAYS and NEVER)",
+ "intersectionParent": "ColumnInfo"
},
"data_type": {
"type": "primitive",
"alias": "string",
"subType": "string",
"optional": false,
- "comments": "Simplified data type"
+ "comments": "Simplified data type",
+ "intersectionParent": "ColumnInfo"
},
"udt_name": {
"type": "reference",
"alias": "PG_COLUMN_UDT_DATA_TYPE",
"aliasSymbolescapedName": "PG_COLUMN_UDT_DATA_TYPE",
- "comments": "Postgres raw data types. values starting with underscore means it's an array of that data type",
- "optional": false
+ "comments": "Postgres data type name.\nArray types start with an underscore",
+ "optional": false,
+ "intersectionParent": "ColumnInfo"
},
"element_type": {
- "type": "primitive",
- "alias": "string",
- "subType": "string",
+ "type": "union",
+ "alias": "string | undefined",
+ "types": [
+ {
+ "type": "primitive",
+ "alias": "undefined",
+ "subType": "undefined"
+ },
+ {
+ "type": "primitive",
+ "alias": "string",
+ "subType": "string"
+ }
+ ],
"optional": false,
- "comments": "Element data type"
+ "comments": "Element data type",
+ "intersectionParent": "ColumnInfo"
},
"element_udt_name": {
- "type": "primitive",
- "alias": "string",
- "subType": "string",
+ "type": "union",
+ "alias": "string | undefined",
+ "types": [
+ {
+ "type": "primitive",
+ "alias": "undefined",
+ "subType": "undefined"
+ },
+ {
+ "type": "primitive",
+ "alias": "string",
+ "subType": "string"
+ }
+ ],
"optional": false,
- "comments": "Element raw data type"
+ "comments": "Element data type name",
+ "intersectionParent": "ColumnInfo"
},
"is_pkey": {
"type": "union",
@@ -314,14 +496,17 @@ export const definitions = [
}
],
"optional": false,
- "comments": "PRIMARY KEY constraint on column. A table can have more then one PK"
+ "comments": "PRIMARY KEY constraint on column.\nA table can have a multi column primary key",
+ "intersectionParent": "ColumnInfo"
},
"references": {
"type": "array",
- "alias": "{ ftable: string; fcols: string[]; cols: string[]; }[]",
+ "alias": "ReferenceTable[]",
"itemType": {
"type": "object",
- "alias": "{ ftable: string; fcols: string[]; cols: string[]; }",
+ "alias": "ReferenceTable",
+ "aliasSymbolescapedName": "ReferenceTable",
+ "comments": "",
"properties": {
"ftable": {
"type": "primitive",
@@ -352,7 +537,8 @@ export const definitions = [
}
},
"optional": true,
- "comments": "Foreign key constraint\nA column can reference multiple tables"
+ "comments": "Foreign key constraint\nA column can reference multiple tables",
+ "intersectionParent": "ColumnInfo"
},
"has_default": {
"type": "union",
@@ -365,14 +551,16 @@ export const definitions = [
}
],
"optional": false,
- "comments": "true if column has a default value\nUsed for excluding pkey from insert"
+ "comments": "true if column has a default value\nUsed for excluding pkey from insert",
+ "intersectionParent": "ColumnInfo"
},
"column_default": {
"type": "primitive",
"alias": "any",
"subType": "any",
"optional": true,
- "comments": "Column default value"
+ "comments": "Column default value",
+ "intersectionParent": "ColumnInfo"
},
"min": {
"type": "union",
@@ -395,7 +583,8 @@ export const definitions = [
}
],
"optional": true,
- "comments": "Extracted from tableConfig\nUsed in SmartForm"
+ "comments": "Extracted from tableConfig\nUsed in SmartForm",
+ "intersectionParent": "ColumnInfo"
},
"max": {
"type": "union",
@@ -417,13 +606,15 @@ export const definitions = [
"subType": "number"
}
],
- "optional": true
+ "optional": true,
+ "intersectionParent": "ColumnInfo"
},
"hint": {
"type": "primitive",
"alias": "string",
"subType": "string",
- "optional": true
+ "optional": true,
+ "intersectionParent": "ColumnInfo"
},
"jsonbSchema": {
"type": "object",
@@ -435,73 +626,85 @@ export const definitions = [
"alias": "any",
"subType": "any",
"optional": true,
- "comments": "False by default"
+ "comments": "False by default",
+ "intersectionParent": "Omit"
},
"description": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"title": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"type": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"allowedValues": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"oneOf": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"oneOfType": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"arrayOf": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"arrayOfType": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"enum": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"record": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"lookup": {
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Omit"
},
"defaultValue": {
"type": "primitive",
@@ -510,7 +713,9 @@ export const definitions = [
"optional": true
}
},
- "optional": true
+ "optional": true,
+ "comments": "JSONB schema (a simplified version of json schema) for the column (if defined in the tableConfig)\nA check constraint will use this schema for runtime data validation and apropriate TS types will be generated",
+ "intersectionParent": "ColumnInfo"
},
"file": {
"type": "union",
@@ -3625,7 +3830,8 @@ export const definitions = [
}
],
"optional": true,
- "comments": "If degined then this column is referencing the file table\nExtracted from FileTable config\nUsed in SmartForm"
+ "comments": "If degined then this column is referencing the file table\nExtracted from FileTable config\nUsed in SmartForm",
+ "intersectionParent": "ColumnInfo"
},
"tsDataType": {
"type": "union",
@@ -3686,7 +3892,7 @@ export const definitions = [
}
],
"optional": false,
- "comments": "Can be viewed/selected"
+ "comments": "Can be viewed/selected\nBased on access rules and postgres policies"
},
"orderBy": {
"type": "union",
@@ -3699,7 +3905,7 @@ export const definitions = [
}
],
"optional": false,
- "comments": "Can be ordered by"
+ "comments": "Can be ordered by\nBased on access rules"
},
"filter": {
"type": "union",
@@ -3712,7 +3918,7 @@ export const definitions = [
}
],
"optional": false,
- "comments": "Can be filtered by"
+ "comments": "Can be filtered by\nBased on access rules"
},
"insert": {
"type": "union",
@@ -3725,7 +3931,7 @@ export const definitions = [
}
],
"optional": false,
- "comments": "Can be inserted"
+ "comments": "Can be inserted\nBased on access rules and postgres policies"
},
"update": {
"type": "union",
@@ -3738,7 +3944,7 @@ export const definitions = [
}
],
"optional": false,
- "comments": "Can be updated"
+ "comments": "Can be updated\nBased on access rules and postgres policies"
},
"delete": {
"type": "union",
@@ -3751,14 +3957,15 @@ export const definitions = [
}
],
"optional": false,
- "comments": "Can be used in the delete filter"
+ "comments": "Can be used in the delete filter\nBased on access rules"
}
}
}
}
},
"optional": false,
- "comments": "Retrieves columns metadata of the table/view"
+ "comments": "Retrieves columns metadata of the table/view",
+ "intersectionParent": "ViewHandler"
},
"find": {
"type": "function",
@@ -3767,147 +3974,197 @@ export const definitions = [
{
"name": "filter",
"optional": true,
- "type": "reference",
+ "type": "union",
"alias": "FullFilter | undefined",
- "comments": ""
- },
- {
- "name": "selectParams",
- "optional": true,
- "type": "object",
- "alias": "SelectParams",
- "aliasSymbolescapedName": "SelectParams",
- "properties": {
- "limit": {
- "type": "union",
- "alias": "number | null | undefined",
- "types": [
- {
- "type": "primitive",
- "alias": "undefined",
- "subType": "undefined"
- },
- {
- "type": "primitive",
- "alias": "null",
- "subType": "null"
- },
- {
+ "types": [
+ {
+ "type": "primitive",
+ "alias": "undefined",
+ "subType": "undefined"
+ },
+ {
+ "type": "object",
+ "alias": "ComplexFilter",
+ "aliasSymbolescapedName": "ComplexFilter",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
+ "properties": {
+ "$filter": {
"type": "primitive",
- "alias": "number",
- "subType": "number"
+ "alias": "any",
+ "subType": "any",
+ "optional": false
}
- ],
- "optional": true,
- "comments": "Max number of rows to return\n- If undefined then 1000 will be applied as the default\n- On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)"
+ }
},
- "offset": {
- "type": "primitive",
- "alias": "number",
- "subType": "number",
- "optional": true,
- "comments": "Number of rows to skip"
+ {
+ "type": "object",
+ "alias": "{ $and: FullFilter[]; }",
+ "properties": {
+ "$and": {
+ "type": "array",
+ "alias": "FullFilter[]",
+ "itemType": {
+ "type": "union",
+ "alias": "FullFilter",
+ "aliasSymbolescapedName": "FullFilter",
+ "comments": "Data filter\n- `{ status: 'live' }`\n- `{ $or: [{ id: 1 }, { status: 'live' }] }`\n- `{ $existsJoined: { referencedTable: { id: 1 } } }`\n- `{\n $filter: [\n { $age: [\"created_at\"] },\n \"<\",\n '1 year'\n ]\n }`",
+ "types": [
+ {
+ "type": "object",
+ "alias": "ComplexFilter",
+ "aliasSymbolescapedName": "ComplexFilter",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "reference",
+ "alias": "{ $and: FullFilter[]; }"
+ },
+ {
+ "type": "object",
+ "alias": "{ $or: FullFilter[]; }",
+ "properties": {
+ "$or": {
+ "type": "reference",
+ "alias": "FullFilter[]",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "NormalFilter>",
+ "aliasSymbolescapedName": "NormalFilter",
+ "comments": "Column filter with operators\nMultiple columns are combined with AND",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true,
+ "intersectionParent": "Partial"
+ }
+ }
+ },
+ {
+ "type": "primitive",
+ "alias": "ShorthandFilter>",
+ "aliasSymbolescapedName": "ShorthandFilter",
+ "comments": "Filters with shorthand notation for autocomplete convenience\nOperator is inside the key: ` \"{columnName}.{operator}\": value`",
+ "subType": "any"
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ $exists: S extends DBSchema ? ExactlyOne<{ [tname in KeyofString]: FullFilter | { path: RawJoinPath[]; filter: FullFilter<...>; }; }> : any; $notExists: S extends DBSchema ? ExactlyOne<...> : any; $existsJoined: S extends DBSchema ? ExactlyOne<...> : any; $notExistsJoined: S exte...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {
+ "$exists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$existsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExistsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ "optional": false
+ }
+ }
},
- "groupBy": {
+ {
+ "type": "object",
+ "alias": "{ $or: FullFilter[]; }",
+ "properties": {
+ "$or": {
+ "type": "reference",
+ "alias": "FullFilter[]",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "NormalFilter>",
+ "aliasSymbolescapedName": "NormalFilter",
+ "comments": "Column filter with operators\nMultiple columns are combined with AND",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true,
+ "intersectionParent": "Partial"
+ }
+ }
+ },
+ {
"type": "primitive",
- "alias": "false",
- "subType": "boolean",
- "optional": true,
- "comments": "Will group by all non aggregated fields specified in select (or all fields by default)"
+ "alias": "ShorthandFilter>",
+ "aliasSymbolescapedName": "ShorthandFilter",
+ "comments": "Filters with shorthand notation for autocomplete convenience\nOperator is inside the key: ` \"{columnName}.{operator}\": value`",
+ "subType": "any"
},
- "returnType": {
- "type": "union",
- "alias": "\"row\" | \"value\" | \"values\" | \"statement\" | \"statement-no-rls\" | \"statement-where\" | undefined",
- "types": [
- {
+ {
+ "type": "object",
+ "alias": "Partial<{ $exists: S extends DBSchema ? ExactlyOne<{ [tname in KeyofString]: FullFilter | { path: RawJoinPath[]; filter: FullFilter<...>; }; }> : any; $notExists: S extends DBSchema ? ExactlyOne<...> : any; $existsJoined: S extends DBSchema ? ExactlyOne<...> : any; $notExistsJoined: S exte...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {
+ "$exists": {
"type": "primitive",
- "alias": "undefined",
- "subType": "undefined"
- },
- {
- "type": "literal",
- "alias": "\"row\"",
- "value": "row"
- },
- {
- "type": "literal",
- "alias": "\"value\"",
- "value": "value"
- },
- {
- "type": "literal",
- "alias": "\"values\"",
- "value": "values"
+ "alias": "any",
+ "subType": "any",
+ "optional": true
},
- {
- "type": "literal",
- "alias": "\"statement\"",
- "value": "statement"
+ "$notExists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
},
- {
- "type": "literal",
- "alias": "\"statement-no-rls\"",
- "value": "statement-no-rls"
+ "$existsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
},
- {
- "type": "literal",
- "alias": "\"statement-where\"",
- "value": "statement-where"
+ "$notExistsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
}
- ],
- "optional": true,
- "comments": "Result data structure/type:\n- row: the first row as an object\n- value: the first value from of first field\n- values: array of values from the selected field\n- statement: sql statement\n- statement-no-rls: sql statement without row level security\n- statement-where: sql statement where condition"
- },
- "select": {
- "type": "primitive",
- "alias": "Select",
- "aliasSymbolescapedName": "Select",
- "comments": "Fields/expressions/linked data to select\n- If empty then all fields will be selected\n- If \"*\" then all fields will be selected\n- If { field: 0 } then all fields except the specified field will be selected\n- If { field: 1 } then only the specified field will be selected\n- If { field: { funcName: [args] } } then the field will be selected with the specified function applied\n- If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields",
- "subType": "any",
- "optional": true
- },
- "orderBy": {
- "type": "primitive",
- "alias": "OrderBy",
- "aliasSymbolescapedName": "OrderBy",
- "subType": "any",
- "optional": true,
- "comments": "Order by options\n- If array then the order will be maintained"
- },
- "having": {
- "type": "reference",
- "alias": "FullFilter | undefined",
- "comments": "Filter applied after any aggregations (group by)",
- "optional": true
+ }
}
- },
- "comments": ""
- }
- ],
- "returnType": {
- "type": "promise",
- "alias": "Promise>",
- "comments": "Represents the completion of an asynchronous operation",
- "innerType": {
- "type": "primitive",
- "alias": "GetSelectReturnType",
- "aliasSymbolescapedName": "GetSelectReturnType",
- "subType": "any"
- }
- },
- "optional": false,
- "comments": "Retrieves a list of matching records from the view/table"
- },
- "findOne": {
- "type": "function",
- "alias": ">(filter?: FullFilter | undefined, selectParams?: P | undefined) => Promise | undefined>",
- "arguments": [
- {
- "name": "filter",
- "optional": true,
- "type": "reference",
- "alias": "FullFilter | undefined",
- "comments": ""
+ ],
+ "comments": "Filter to apply. Undefined will return all records\n- { \"field\": \"value\" }\n- { \"field\": { $in: [\"value\", \"value2\"] } }\n- { $or: [\n { \"field1\": \"value\" },\n { \"field2\": \"value\" }\n ]\n }\n- { $existsJoined: { linkedTable: { \"linkedTableField\": \"value\" } } }"
},
{
"name": "selectParams",
@@ -3937,21 +4194,24 @@ export const definitions = [
}
],
"optional": true,
- "comments": "Max number of rows to return\n- If undefined then 1000 will be applied as the default\n- On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)"
+ "comments": "Max number of rows to return. Defaults to 1000\n- On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)",
+ "intersectionParent": "CommonSelectParams"
},
"offset": {
"type": "primitive",
"alias": "number",
"subType": "number",
"optional": true,
- "comments": "Number of rows to skip"
+ "comments": "Number of rows to skip",
+ "intersectionParent": "CommonSelectParams"
},
"groupBy": {
"type": "primitive",
"alias": "false",
"subType": "boolean",
"optional": true,
- "comments": "Will group by all non aggregated fields specified in select (or all fields by default)"
+ "comments": "Will group by all non aggregated fields specified in select (or all fields by default)",
+ "intersectionParent": "CommonSelectParams"
},
"returnType": {
"type": "union",
@@ -3994,13 +4254,14 @@ export const definitions = [
}
],
"optional": true,
- "comments": "Result data structure/type:\n- row: the first row as an object\n- value: the first value from of first field\n- values: array of values from the selected field\n- statement: sql statement\n- statement-no-rls: sql statement without row level security\n- statement-where: sql statement where condition"
+ "comments": "Result data structure/type:\n- **row**: the first row as an object\n- **value**: the first value from of first field\n- **values**: array of values from the selected field\n- **statement**: sql statement\n- **statement-no-rls**: sql statement without row level security\n- **statement-where**: sql statement where condition",
+ "intersectionParent": "CommonSelectParams"
},
"select": {
"type": "primitive",
"alias": "Select",
"aliasSymbolescapedName": "Select",
- "comments": "Fields/expressions/linked data to select\n- If empty then all fields will be selected\n- If \"*\" then all fields will be selected\n- If { field: 0 } then all fields except the specified field will be selected\n- If { field: 1 } then only the specified field will be selected\n- If { field: { funcName: [args] } } then the field will be selected with the specified function applied\n- If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields",
+ "comments": "Fields/expressions/linked data to select\n- `\"*\"` or empty will return all fields\n- `{ field: 0 }` - all fields except the specified field will be selected\n- `{ field: 1 }` - only the specified field will be selected\n- `{ field: { $funcName: [args] } }` - the field will be selected with the specified function applied\n- `{ field: 1, referencedTable: \"*\" }` - field together with all fields from referencedTable will be selected\n- `{ linkedData: { referencedTable: { field: 1 } } }` - linkedData will contain the linked/joined records from referencedTable",
"subType": "any",
"optional": true
},
@@ -4010,254 +4271,22 @@ export const definitions = [
"aliasSymbolescapedName": "OrderBy",
"subType": "any",
"optional": true,
- "comments": "Order by options\n- If array then the order will be maintained"
+ "comments": "Order by options\n- Order is maintained in arrays\n- `[{ key: \"field\", asc: true, nulls: \"last\" }]`"
},
"having": {
- "type": "reference",
- "alias": "FullFilter | undefined",
- "comments": "Filter applied after any aggregations (group by)",
- "optional": true
- }
- },
- "comments": ""
- }
- ],
- "returnType": {
- "type": "promise",
- "alias": "Promise | undefined>",
- "comments": "Represents the completion of an asynchronous operation",
- "innerType": {
- "type": "union",
- "alias": "GetSelectReturnType | undefined",
- "types": [
- {
- "type": "primitive",
- "alias": "undefined",
- "subType": "undefined"
- },
- {
- "type": "primitive",
- "alias": "GetSelectReturnType",
- "aliasSymbolescapedName": "GetSelectReturnType",
- "subType": "any"
- }
- ]
- }
- },
- "optional": false,
- "comments": "Retrieves a record from the view/table"
- },
- "subscribe": {
- "type": "function",
- "alias": ">(filter: FullFilter, params: P, onData: (items: GetSelectReturnType) => any, onError?: OnError | undefined) => Promise<...>",
- "arguments": [
- {
- "name": "filter",
- "optional": false,
- "type": "reference",
- "alias": "FullFilter",
- "aliasSymbolescapedName": "FullFilter",
- "comments": "Group or simple filter"
- },
- {
- "name": "params",
- "optional": false,
- "type": "object",
- "alias": "SelectParams",
- "aliasSymbolescapedName": "SelectParams",
- "properties": {
- "limit": {
"type": "union",
- "alias": "number | null | undefined",
+ "alias": "FullFilter | undefined",
"types": [
{
"type": "primitive",
"alias": "undefined",
"subType": "undefined"
},
- {
- "type": "primitive",
- "alias": "null",
- "subType": "null"
- },
- {
- "type": "primitive",
- "alias": "number",
- "subType": "number"
- }
- ],
- "optional": true,
- "comments": "Max number of rows to return\n- If undefined then 1000 will be applied as the default\n- On client publish rules can affect this behaviour: cannot request more than the maxLimit (if present)"
- },
- "offset": {
- "type": "primitive",
- "alias": "number",
- "subType": "number",
- "optional": true,
- "comments": "Number of rows to skip"
- },
- "groupBy": {
- "type": "primitive",
- "alias": "false",
- "subType": "boolean",
- "optional": true,
- "comments": "Will group by all non aggregated fields specified in select (or all fields by default)"
- },
- "returnType": {
- "type": "union",
- "alias": "\"row\" | \"value\" | \"values\" | \"statement\" | \"statement-no-rls\" | \"statement-where\" | undefined",
- "types": [
- {
- "type": "primitive",
- "alias": "undefined",
- "subType": "undefined"
- },
- {
- "type": "literal",
- "alias": "\"row\"",
- "value": "row"
- },
- {
- "type": "literal",
- "alias": "\"value\"",
- "value": "value"
- },
- {
- "type": "literal",
- "alias": "\"values\"",
- "value": "values"
- },
- {
- "type": "literal",
- "alias": "\"statement\"",
- "value": "statement"
- },
- {
- "type": "literal",
- "alias": "\"statement-no-rls\"",
- "value": "statement-no-rls"
- },
- {
- "type": "literal",
- "alias": "\"statement-where\"",
- "value": "statement-where"
- }
- ],
- "optional": true,
- "comments": "Result data structure/type:\n- row: the first row as an object\n- value: the first value from of first field\n- values: array of values from the selected field\n- statement: sql statement\n- statement-no-rls: sql statement without row level security\n- statement-where: sql statement where condition"
- },
- "select": {
- "type": "primitive",
- "alias": "Select",
- "aliasSymbolescapedName": "Select",
- "comments": "Fields/expressions/linked data to select\n- If empty then all fields will be selected\n- If \"*\" then all fields will be selected\n- If { field: 0 } then all fields except the specified field will be selected\n- If { field: 1 } then only the specified field will be selected\n- If { field: { funcName: [args] } } then the field will be selected with the specified function applied\n- If { field: { nestedTable: { field: 1 } } } then the field will be selected with the nested table fields",
- "subType": "any",
- "optional": true
- },
- "orderBy": {
- "type": "primitive",
- "alias": "OrderBy",
- "aliasSymbolescapedName": "OrderBy",
- "subType": "any",
- "optional": true,
- "comments": "Order by options\n- If array then the order will be maintained"
- },
- "having": {
- "type": "reference",
- "alias": "FullFilter | undefined",
- "comments": "Filter applied after any aggregations (group by)",
- "optional": true
- }
- },
- "comments": ""
- },
- {
- "name": "onData",
- "optional": false,
- "type": "function",
- "alias": "(items: GetSelectReturnType) => any",
- "arguments": [
- {
- "name": "items",
- "optional": false,
- "type": "primitive",
- "alias": "GetSelectReturnType",
- "aliasSymbolescapedName": "GetSelectReturnType",
- "subType": "any",
- "comments": ""
- }
- ],
- "returnType": {
- "type": "primitive",
- "alias": "any",
- "subType": "any"
- },
- "comments": ""
- },
- {
- "name": "onError",
- "optional": true,
- "type": "function",
- "alias": "OnError",
- "aliasSymbolescapedName": "OnError",
- "arguments": [
- {
- "name": "err",
- "optional": false,
- "type": "primitive",
- "alias": "any",
- "subType": "any",
- "comments": ""
- }
- ],
- "returnType": {
- "type": "primitive",
- "alias": "void",
- "subType": "any"
- },
- "comments": ""
- }
- ],
- "returnType": {
- "type": "promise",
- "alias": "Promise",
- "comments": "Represents the completion of an asynchronous operation",
- "innerType": {
- "type": "object",
- "alias": "SubscriptionHandler",
- "aliasSymbolescapedName": "SubscriptionHandler",
- "comments": "",
- "properties": {
- "unsubscribe": {
- "type": "function",
- "alias": "() => Promise",
- "arguments": [],
- "returnType": {
- "type": "promise",
- "alias": "Promise",
- "comments": "Represents the completion of an asynchronous operation",
- "innerType": {
- "type": "primitive",
- "alias": "any",
- "subType": "any"
- }
- },
- "optional": false
- },
- "filter": {
- "type": "union",
- "alias": "{} | FullFilter",
- "types": [
- {
- "type": "object",
- "alias": "{}",
- "properties": {}
- },
{
"type": "object",
"alias": "ComplexFilter",
"aliasSymbolescapedName": "ComplexFilter",
- "comments": "Complex filter that allows applying functions to columns",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
"properties": {
"$filter": {
"type": "primitive",
@@ -4269,16 +4298,101 @@ export const definitions = [
},
{
"type": "object",
- "alias": "{ $and: FullFilter[]; }",
+ "alias": "{ $and: FullFilter[]; }",
"properties": {
"$and": {
"type": "array",
- "alias": "FullFilter[]",
+ "alias": "FullFilter[]",
"itemType": {
- "type": "reference",
- "alias": "FullFilter",
+ "type": "union",
+ "alias": "FullFilter",
"aliasSymbolescapedName": "FullFilter",
- "comments": "Group or simple filter"
+ "comments": "Data filter\n- `{ status: 'live' }`\n- `{ $or: [{ id: 1 }, { status: 'live' }] }`\n- `{ $existsJoined: { referencedTable: { id: 1 } } }`\n- `{\n $filter: [\n { $age: [\"created_at\"] },\n \"<\",\n '1 year'\n ]\n }`",
+ "types": [
+ {
+ "type": "object",
+ "alias": "ComplexFilter",
+ "aliasSymbolescapedName": "ComplexFilter",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "reference",
+ "alias": "{ $and: FullFilter[]; }"
+ },
+ {
+ "type": "object",
+ "alias": "{ $or: FullFilter[]; }",
+ "properties": {
+ "$or": {
+ "type": "reference",
+ "alias": "FullFilter[]",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "NormalFilter>",
+ "aliasSymbolescapedName": "NormalFilter",
+ "comments": "Column filter with operators\nMultiple columns are combined with AND",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true,
+ "intersectionParent": "Partial"
+ }
+ }
+ },
+ {
+ "type": "primitive",
+ "alias": "ShorthandFilter>",
+ "aliasSymbolescapedName": "ShorthandFilter",
+ "comments": "Filters with shorthand notation for autocomplete convenience\nOperator is inside the key: ` \"{columnName}.{operator}\": value`",
+ "subType": "any"
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ $exists: S extends DBSchema ? ExactlyOne<{ [tname in KeyofString]: FullFilter | { path: RawJoinPath[]; filter: FullFilter<...>; }; }> : any; $notExists: S extends DBSchema ? ExactlyOne<...> : any; $existsJoined: S extends DBSchema ? ExactlyOne<...> : any; $notExistsJoined: S exte...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {
+ "$exists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$existsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExistsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ }
+ }
+ }
+ ]
},
"optional": false
}
@@ -4286,18 +4400,18 @@ export const definitions = [
},
{
"type": "object",
- "alias": "{ $or: FullFilter[]; }",
+ "alias": "{ $or: FullFilter[]; }",
"properties": {
"$or": {
"type": "reference",
- "alias": "FullFilter[]",
+ "alias": "FullFilter[]",
"optional": false
}
}
},
{
"type": "object",
- "alias": "NormalFilter",
+ "alias": "NormalFilter>",
"aliasSymbolescapedName": "NormalFilter",
"comments": "Column filter with operators\nMultiple columns are combined with AND",
"properties": {
@@ -4305,52 +4419,21 @@ export const definitions = [
"type": "primitive",
"alias": "any",
"subType": "any",
- "optional": true
+ "optional": true,
+ "intersectionParent": "Partial"
}
}
},
{
- "type": "object",
- "alias": "Partial<{ [x: `${string}.=`]: any; [x: `${string}.$eq`]: any; [x: `${string}.<>`]: any; [x: `${string}.>`]: any; [x: `${string}.<`]: any; [x: `${string}.>=`]: any; [x: `${string}.<=`]: any; [x: `${string}.$ne`]: any; [x: `${string}.$gt`]: any; [x: `${string}.$gte`]: any; [x: `${string}.$lt`]: any; [x: `${string}.$lt...",
- "aliasSymbolescapedName": "Partial",
- "comments": "Make all properties in T optional",
- "properties": {}
- },
- {
- "type": "object",
- "alias": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }>",
- "aliasSymbolescapedName": "Partial",
- "comments": "Make all properties in T optional",
- "properties": {},
- "intersectionParent": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }> & Partial<{ [x: `${string}.@@`]: any; [x: `${string}.@>`]: any; [x: `${string}.<@`]: any; [x: `${string}.$contains`]: any; [x: `${string}.$containedBy`]: any; }>"
- },
- {
- "type": "object",
- "alias": "Partial<{ [x: `${string}.=`]: any; [x: `${string}.$eq`]: any; [x: `${string}.<>`]: any; [x: `${string}.>`]: any; [x: `${string}.<`]: any; [x: `${string}.>=`]: any; [x: `${string}.<=`]: any; [x: `${string}.$ne`]: any; [x: `${string}.$gt`]: any; [x: `${string}.$gte`]: any; [x: `${string}.$lt`]: any; [x: `${string}.$lt...",
- "aliasSymbolescapedName": "Partial",
- "comments": "Make all properties in T optional",
- "properties": {}
+ "type": "primitive",
+ "alias": "ShorthandFilter>",
+ "aliasSymbolescapedName": "ShorthandFilter",
+ "comments": "Filters with shorthand notation for autocomplete convenience\nOperator is inside the key: ` \"{columnName}.{operator}\": value`",
+ "subType": "any"
},
{
"type": "object",
- "alias": "Partial<{ [x: `${string}.=`]: any; [x: `${string}.$eq`]: any; [x: `${string}.<>`]: any; [x: `${string}.>`]: any; [x: `${string}.<`]: any; [x: `${string}.>=`]: any; [x: `${string}.<=`]: any; [x: `${string}.$ne`]: any; [x: `${string}.$gt`]: any; [x: `${string}.$gte`]: any; [x: `${string}.$lt`]: any; [x: `${string}.$lt...",
- "aliasSymbolescapedName": "Partial",
- "comments": "Make all properties in T optional",
- "properties": {}
- },
- {
- "type": "object",
- "alias": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }> & Partial<{ [x: `${string}.$ilike`]: any; [x: `${string}.$like`]: any; [x: `${string}.$nilike`]: any; [x: `${string}.$nlike`]: any; }>",
- "properties": {}
- },
- {
- "type": "object",
- "alias": "Partial<{ [x: `${string}.$in`]: any[]; [x: `${string}.$nin`]: any[]; }> & Partial<{ [x: `${string}.@@`]: any; [x: `${string}.@>`]: any; [x: `${string}.<@`]: any; [x: `${string}.$contains`]: any; [x: `${string}.$containedBy`]: any; }>",
- "properties": {}
- },
- {
- "type": "object",
- "alias": "Partial<{ $exists: any; $notExists: any; $existsJoined: any; $notExistsJoined: any; }>",
+ "alias": "Partial<{ $exists: S extends DBSchema ? ExactlyOne<{ [tname in KeyofString]: FullFilter | { path: RawJoinPath[]; filter: FullFilter<...>; }; }> : any; $notExists: S extends DBSchema ? ExactlyOne<...> : any; $existsJoined: S extends DBSchema ? ExactlyOne<...> : any; $notExistsJoined: S exte...",
"aliasSymbolescapedName": "Partial",
"comments": "Make all properties in T optional",
"properties": {
@@ -4381,29 +4464,230 @@ export const definitions = [
}
}
],
- "optional": false
+ "optional": true,
+ "comments": "Filter applied after any aggregations (group by)"
}
- }
+ },
+ "comments": ""
+ }
+ ],
+ "returnType": {
+ "type": "promise",
+ "alias": "Promise>",
+ "comments": "Represents the completion of an asynchronous operation",
+ "innerType": {
+ "type": "primitive",
+ "alias": "GetSelectReturnType",
+ "aliasSymbolescapedName": "GetSelectReturnType",
+ "subType": "any"
}
},
"optional": false,
- "comments": "Retrieves a list of matching records from the view/table and subscribes to changes"
+ "comments": "Retrieves a list of matching records from the view/table",
+ "intersectionParent": "ViewHandler"
},
- "subscribeOne": {
+ "findOne": {
"type": "function",
- "alias": ">(filter: FullFilter, params: P, onData: (item: GetSelectReturnType | undefined) => any, onError?: OnError | undefined) => Promise<...>",
+ "alias": ">(filter?: FullFilter | undefined, selectParams?: P | undefined) => Promise | undefined>",
"arguments": [
{
"name": "filter",
- "optional": false,
- "type": "reference",
- "alias": "FullFilter",
- "aliasSymbolescapedName": "FullFilter",
- "comments": "Group or simple filter"
+ "optional": true,
+ "type": "union",
+ "alias": "FullFilter | undefined",
+ "types": [
+ {
+ "type": "primitive",
+ "alias": "undefined",
+ "subType": "undefined"
+ },
+ {
+ "type": "object",
+ "alias": "ComplexFilter",
+ "aliasSymbolescapedName": "ComplexFilter",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "{ $and: FullFilter[]; }",
+ "properties": {
+ "$and": {
+ "type": "array",
+ "alias": "FullFilter[]",
+ "itemType": {
+ "type": "union",
+ "alias": "FullFilter",
+ "aliasSymbolescapedName": "FullFilter",
+ "comments": "Data filter\n- `{ status: 'live' }`\n- `{ $or: [{ id: 1 }, { status: 'live' }] }`\n- `{ $existsJoined: { referencedTable: { id: 1 } } }`\n- `{\n $filter: [\n { $age: [\"created_at\"] },\n \"<\",\n '1 year'\n ]\n }`",
+ "types": [
+ {
+ "type": "object",
+ "alias": "ComplexFilter",
+ "aliasSymbolescapedName": "ComplexFilter",
+ "comments": "Complex filter that allows applying functions to columns\n `{\n $filter: [\n { $funcName: [...args] },\n operand,\n value | funcFilter\n ]\n }`",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "reference",
+ "alias": "{ $and: FullFilter[]; }"
+ },
+ {
+ "type": "object",
+ "alias": "{ $or: FullFilter[]; }",
+ "properties": {
+ "$or": {
+ "type": "reference",
+ "alias": "FullFilter[]",
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "NormalFilter>",
+ "aliasSymbolescapedName": "NormalFilter",
+ "comments": "Column filter with operators\nMultiple columns are combined with AND",
+ "properties": {
+ "$filter": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true,
+ "intersectionParent": "Partial"
+ }
+ }
+ },
+ {
+ "type": "primitive",
+ "alias": "ShorthandFilter>",
+ "aliasSymbolescapedName": "ShorthandFilter",
+ "comments": "Filters with shorthand notation for autocomplete convenience\nOperator is inside the key: ` \"{columnName}.{operator}\": value`",
+ "subType": "any"
+ },
+ {
+ "type": "object",
+ "alias": "Partial<{ $exists: S extends DBSchema ? ExactlyOne<{ [tname in KeyofString]: FullFilter | { path: RawJoinPath[]; filter: FullFilter<...>; }; }> : any; $notExists: S extends DBSchema ? ExactlyOne<...> : any; $existsJoined: S extends DBSchema ? ExactlyOne<...> : any; $notExistsJoined: S exte...",
+ "aliasSymbolescapedName": "Partial",
+ "comments": "Make all properties in T optional",
+ "properties": {
+ "$exists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExists": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$existsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ },
+ "$notExistsJoined": {
+ "type": "primitive",
+ "alias": "any",
+ "subType": "any",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ "optional": false
+ }
+ }
+ },
+ {
+ "type": "object",
+ "alias": "{ $or: FullFilter