Can be used in insert
and update
operations, to set the value
of a column to its default value.
This can only be used on table columns that have been declared as "default-able" when the table was declared using declareTable.
This is like using the DEFAULT
keyword in SQL.
Delete rows of a table
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Which rows should be deleted (the WHERE clause)
number of rows deleted
Returns true if the string matches the supplied pattern, using case-insensitive matching
SQL equivalent: ILIKE
The string to be matched against
The pattern to use. May use special characters '%' and '_'
Returns true if the string matches the supplied pattern, using case-insensitive matching
SQL equivalent: ILIKE
The string to be matched against
The pattern to use. May use special characters '%' and '_'
Explicitly create an inner query.
Sometimes it's handy, for performance reasons and otherwise, to perform a subquery and restrict only that query before adding the result of the query to the result set, instead of first adding the query to the result set and restricting the whole result set afterwards.
Insert a single row into a table
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert multiple rows into a table
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert multiple rows into a table, with an ON CONFLICT DO NOTHING clause
The number of rows inserted
Insert multiple rows into a table, with an ON CONFLICT DO NOTHING clause, and with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert multiple rows into a table, with an ON CONFLICT DO UPDATE clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Which rows should be updated (the WHERE clause)
A function that returns the new values for a row.
You may use <a href="index.html#defaultvalue">defaultValue</a> on "default-able" columns.
Should have an explicit annotation of the return type, in order to catch excess properties.
See: <https://github.com/Microsoft/TypeScript/issues/7547#issuecomment-218017839>
The number of newly inserted rows + the number of updated rows
Insert multiple rows into a table, with an ON CONFLICT DO UPDATE clause, and with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert multiple rows into a table, with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert a single row into a table, with an ON CONFLICT DO NOTHING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
true if the row was inserted
Insert a single row into a table, with an ON CONFLICT DO NOTHING clause, and with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert a single row into a table, with an ON CONFLICT DO UPDATE clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Which rows should be updated (the WHERE clause)
A function that returns the new values for a row.
You may use <a href="index.html#defaultvalue">defaultValue</a> on "default-able" columns.
Should have an explicit annotation of the return type, in order to catch excess properties.
See: <https://github.com/Microsoft/TypeScript/issues/7547#issuecomment-218017839>
If a new row was inserted returns true.
If a conflicting row already existed but was updated returns true.
If a conflicting row already existed and was not updated returns false.
Insert a single row into a table, with an ON CONFLICT DO UPDATE clause, and with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Insert a single row into a table, with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Returns true if the string matches the supplied pattern
SQL equivalent: LIKE
The string to be matched against
The pattern to use. May use special characters '%' and '_'
Returns true if the string matches the supplied pattern
SQL equivalent: LIKE
The string to be matched against
The pattern to use. May use special characters '%' and '_'
Applies the given function to the given nullable column where it isn't null, and returns the given default value where it is.
A nullable column to match against
This is the value that will be returned if the nullable column is NULL
This function will be called if the nullable column is not null, and its result will be returned
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Similar to query, but when you are certain that the query will always return exactly 1 row.
For example: COUNT(*) style queries
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Similar to query, but when you are certain that the query will always return either 1 row or 0 rows.
For example: queries that are restricted on some primary key
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Perform a query, but stream the results rather than loading them all into memory.
After you call this function, you must call the readAllRows
function, and
you must call it while the connection is still open (and don't close the
connection until it completes).
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
How many rows to read and process during each iteration
Update rows of a table
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Which rows should be updated (the WHERE clause)
A function that returns the new values for a row.
You may use <a href="index.html#defaultvalue">defaultValue</a> on "default-able" columns.
Should have an explicit annotation of the return type, in order to catch excess properties.
See: <https://github.com/Microsoft/TypeScript/issues/7547#issuecomment-218017839>
number of rows updated
Update rows of a table, with a RETURNING clause
Will be injected as a comment into the SQL that is sent to the server. Useful for identifying the query during log analysis and performance analysis
Which rows should be updated (the WHERE clause)
A function that returns the new values for a row.
You may use <a href="index.html#defaultvalue">defaultValue</a> on "default-able" columns.
Should have an explicit annotation of the return type, in order to catch excess properties.
See: <https://github.com/Microsoft/TypeScript/issues/7547#issuecomment-218017839>
Generated using TypeDoc
An arbitrary column, useful for queries where the values of the returned rows are not important, such as in exists queries.