PostgresBuilder class
Methods
batchedInsertOrReplace (QualifiedTablename table , List <String > columns , List <Map <String , Object ? > > records , List <String > conflictCols , List <String > updateCols , int maxSqlParameters )
→ List <Statement >
Inserts a batch of rows into a table, replacing them if they already exist.
override
countTablesIn (List <String > tableNames )
→ Statement
Counts tables whose name is included in tableNames
.
override
createFkCompensationTrigger (String opType , QualifiedTablename table , String childKey , QualifiedTablename fkTable , String joinedFkPKs , ForeignKey foreignKey )
→ List <String >
Creates a trigger that logs compensations for operations into the oplog.
override
createIndex (String indexName , QualifiedTablename onTable , List <String > columns )
→ String
Create an index on a table.
override
createJsonbObject (String rows )
→ String
createNoFkUpdateTrigger (QualifiedTablename table , List <String > pk )
→ List <String >
Create a trigger that prevents updates to the primary key.
override
createOplogTrigger (SqlOpType opType , QualifiedTablename table , String newPKs , String newRows , String oldRows )
→ List <String >
Create a trigger that logs operations into the oplog.
override
createOrReplaceDeleteTrigger (QualifiedTablename table , String newPKs , String newRows , String oldRows )
→ List <String >
Creates or replaces a trigger that logs deletions into the oplog.
inherited
createOrReplaceFkCompensationTrigger (String opType , QualifiedTablename table , String childKey , QualifiedTablename fkTable , String joinedFkPKs , ForeignKey foreignKey )
→ List <String >
inherited
createOrReplaceInsertCompensationTrigger (QualifiedTablename table , String childKey , QualifiedTablename fkTable , String joinedFkPKs , ForeignKey foreignKey )
→ List <String >
Creates a trigger that logs compensations for insertions into the oplog.
inherited
createOrReplaceInsertTrigger (QualifiedTablename table , String newPKs , String newRows , String oldRows )
→ List <String >
Creates or replaces a trigger that logs insertions into the oplog.
inherited
createOrReplaceNoFkUpdateTrigger (QualifiedTablename table , List <String > pk )
→ List <String >
Creates or replaces a trigger that prevents updates to the primary key.
inherited
createOrReplaceOplogTrigger (SqlOpType opType , QualifiedTablename table , String newPKs , String newRows , String oldRows )
→ List <String >
inherited
createOrReplaceUpdateCompensationTrigger (QualifiedTablename table , String childKey , QualifiedTablename fkTable , String joinedFkPKs , ForeignKey foreignKey )
→ List <String >
Creates a trigger that logs compensations for updates into the oplog.
inherited
createOrReplaceUpdateTrigger (QualifiedTablename table , String newPKs , String newRows , String oldRows )
→ List <String >
Creates or replaces a trigger that logs updates into the oplog.
inherited
createPKJsonObject (String rows )
→ String
dropTriggerIfExists (String triggerName , QualifiedTablename table )
→ String
Drop a trigger if it exists.
override
getLocalTableNames ([List <String > notIn = const [] ])
→ Statement
Fetches the names of all tables that are not in notIn
.
override
getTableInfo (QualifiedTablename table )
→ Statement
Fetches information about the columns of a table.
The information includes all column names, their type,
whether or not they are nullable, and whether they are part of the PK.
override
hexValue (String hexString )
→ String
Converts a hexidecimal string to a hex value.
override
insertOrIgnore (QualifiedTablename table , List <String > columns , List <Object ? > values )
→ Statement
Insert a row into a table, ignoring it if it already exists.
override
insertOrReplace (QualifiedTablename table , List <String > columns , List <Object ? > values , List <String > conflictCols , List <String > updateCols )
→ Statement
Insert a row into a table, replacing it if it already exists.
override
insertOrReplaceWith (QualifiedTablename table , List <String > columns , List <Object ? > values , List <String > conflictCols , List <String > updateCols , List <Object ? > updateVals )
→ Statement
Insert a row into a table.
If it already exists we update the provided columns updateCols
with the provided values updateVals
override
makePositionalParam (int i )
→ String
Makes the i-th positional parameter,
e.g. '$3' For Postgres when i
is 3
and always '?' for SQLite
override
makeQT (String tablename )
→ QualifiedTablename
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pgOnly (String query )
→ String
Returns the given query if the current SQL dialect is PostgreSQL.
override
prepareDeleteBatchedStatements (String baseSql , List <String > columns , List <Map <String , Object ? > > records , int maxParameters , {String suffixSql = '' })
→ List <Statement >
Prepare multiple batched DELETE statements for an array of records.
inherited
prepareInsertBatchedStatements (String baseSql , List <String > columns , List <Map <String , Object ? > > records , int maxParameters , [String suffixSql = '' ])
→ List <Statement >
Prepare multiple batched insert statements for an array of records.
inherited
removeDeletedShadowRows (QualifiedTablename oplog , QualifiedTablename shadow )
→ String
Deletes any shadow rows where the last oplog operation was a DELETE
override
removeSpaceAndNullValuesFromJson (String j )
→ String
setTagsForShadowRows (QualifiedTablename oplog , QualifiedTablename shadow )
→ String
For each affected shadow row, set new tag array, unless the last oplog operation was a DELETE
override
setTriggerSetting (QualifiedTablename table , int value )
→ String
Modifies the trigger setting for the table identified by its tablename and namespace.
override
sqliteOnly (String query )
→ String
Returns the given query if the current SQL dialect is SQLite.
override
tableExists (QualifiedTablename table )
→ Statement
Checks if the given table exists.
override
toHex (String column )
→ String
Converts a column value to a hexidecimal string.
override
toString ()
→ String
A string representation of this object.
inherited