Skip to main content

Class: abstract SqlRewriter

A SqlVisitor for persistently rewriting SQL trees. This class provides methods for visiting different types of SQL nodes and rewriting them.

Extends

Constructors

new SqlRewriter()

new SqlRewriter(): SqlRewriter

Returns

SqlRewriter

Inherited from

SqlVisitor.constructor

Methods

beforeVisit()

protected beforeVisit(node: SqlNode): void

Parameters

ParameterType
nodeSqlNode

Returns

void

Defined in

packages/verse-core/src/db/rewriter.ts:67


rewriteList()

rewriteList<T>(list?: List<T>): undefined | List<T>

Type Parameters

Type Parameter
T extends SqlNode

Parameters

ParameterType
list?List<T>

Returns

undefined | List<T>

Defined in

packages/verse-core/src/db/rewriter.ts:323


rewriteProjection()

rewriteProjection(projection: SqlNode): SqlNode

Parameters

ParameterType
projectionSqlNode

Returns

SqlNode

Defined in

packages/verse-core/src/db/rewriter.ts:319


visitAddColumn()

visitAddColumn(addColumn: SqlAddColumn): SqlNode

Parameters

ParameterType
addColumnSqlAddColumn

Returns

SqlNode

Overrides

SqlVisitor.visitAddColumn

Defined in

packages/verse-core/src/db/rewriter.ts:169


visitAddForeignKey()

visitAddForeignKey(addConstraint: SqlAddForeignKey): SqlNode

Parameters

ParameterType
addConstraintSqlAddForeignKey

Returns

SqlNode

Overrides

SqlVisitor.visitAddForeignKey

Defined in

packages/verse-core/src/db/rewriter.ts:289


visitAddPrimaryKey()

visitAddPrimaryKey(addPrimaryKey: SqlAddPrimaryKey): SqlAddPrimaryKey

Parameters

ParameterType
addPrimaryKeySqlAddPrimaryKey

Returns

SqlAddPrimaryKey

Overrides

SqlVisitor.visitAddPrimaryKey

Defined in

packages/verse-core/src/db/rewriter.ts:179


visitAlias()

visitAlias(alias: SqlAlias): SqlNode

Parameters

ParameterType
aliasSqlAlias

Returns

SqlNode

Overrides

SqlVisitor.visitAlias

Defined in

packages/verse-core/src/db/rewriter.ts:74


visitAlterColumn()

visitAlterColumn(alterColumn: SqlAlterColumn): SqlNode

Parameters

ParameterType
alterColumnSqlAlterColumn

Returns

SqlNode

Overrides

SqlVisitor.visitAlterColumn

Defined in

packages/verse-core/src/db/rewriter.ts:174


visitBinary()

visitBinary(binary: SqlBinary): SqlNode

Parameters

ParameterType
binarySqlBinary

Returns

SqlNode

Overrides

SqlVisitor.visitBinary

Defined in

packages/verse-core/src/db/rewriter.ts:84


visitBoolean()

visitBoolean(boolean: SqlBoolean): SqlNode

Parameters

ParameterType
booleanSqlBoolean

Returns

SqlNode

Overrides

SqlVisitor.visitBoolean

Defined in

packages/verse-core/src/db/rewriter.ts:254


visitCase()

visitCase(cas: SqlCase): SqlNode

Parameters

ParameterType
casSqlCase

Returns

SqlNode

Overrides

SqlVisitor.visitCase

Defined in

packages/verse-core/src/db/rewriter.ts:314


visitColumn()

visitColumn(column: SqlColumn): SqlNode

Parameters

ParameterType
columnSqlColumn

Returns

SqlNode

Overrides

SqlVisitor.visitColumn

Defined in

packages/verse-core/src/db/rewriter.ts:194


visitComposite()

visitComposite(composite: SqlComposite): SqlNode

Parameters

ParameterType
compositeSqlComposite

Returns

SqlNode

Overrides

SqlVisitor.visitComposite

Defined in

packages/verse-core/src/db/rewriter.ts:119


visitCreateDatabase()

visitCreateDatabase(createDatabase: SqlCreateDatabase): SqlNode

Parameters

ParameterType
createDatabaseSqlCreateDatabase

Returns

SqlNode

Overrides

SqlVisitor.visitCreateDatabase

Defined in

packages/verse-core/src/db/rewriter.ts:124


visitCreateIndex()

visitCreateIndex(createIndex: SqlCreateIndex): SqlNode

Parameters

ParameterType
createIndexSqlCreateIndex

Returns

SqlNode

Overrides

SqlVisitor.visitCreateIndex

Defined in

packages/verse-core/src/db/rewriter.ts:159


visitCreateSequence()

visitCreateSequence(createSequence: SqlCreateSequence): SqlNode

Parameters

ParameterType
createSequenceSqlCreateSequence

Returns

SqlNode

Overrides

SqlVisitor.visitCreateSequence

Defined in

packages/verse-core/src/db/rewriter.ts:149


visitCreateTable()

visitCreateTable(createTable: SqlCreateTable): SqlCreateTable

Parameters

ParameterType
createTableSqlCreateTable

Returns

SqlCreateTable

Overrides

SqlVisitor.visitCreateTable

Defined in

packages/verse-core/src/db/rewriter.ts:134


visitDelete()

visitDelete(_delete: SqlDelete): SqlNode

Parameters

ParameterType
_deleteSqlDelete

Returns

SqlNode

Overrides

SqlVisitor.visitDelete

Defined in

packages/verse-core/src/db/rewriter.ts:224


visitDropColumn()

visitDropColumn(dropColumn: SqlDropColumn): SqlNode

Parameters

ParameterType
dropColumnSqlDropColumn

Returns

SqlNode

Overrides

SqlVisitor.visitDropColumn

Defined in

packages/verse-core/src/db/rewriter.ts:184


visitDropDatabase()

visitDropDatabase(dropDatabase: SqlDropDatabase): SqlNode

Parameters

ParameterType
dropDatabaseSqlDropDatabase

Returns

SqlNode

Overrides

SqlVisitor.visitDropDatabase

Defined in

packages/verse-core/src/db/rewriter.ts:129


visitDropIndex()

visitDropIndex(dropIndex: SqlDropIndex): SqlNode

Parameters

ParameterType
dropIndexSqlDropIndex

Returns

SqlNode

Overrides

SqlVisitor.visitDropIndex

Defined in

packages/verse-core/src/db/rewriter.ts:164


visitDropSequence()

visitDropSequence(dropSequence: SqlDropSequence): SqlNode

Parameters

ParameterType
dropSequenceSqlDropSequence

Returns

SqlNode

Overrides

SqlVisitor.visitDropSequence

Defined in

packages/verse-core/src/db/rewriter.ts:154


visitDropTable()

visitDropTable(dropTable: SqlDropTable): SqlNode

Parameters

ParameterType
dropTableSqlDropTable

Returns

SqlNode

Overrides

SqlVisitor.visitDropTable

Defined in

packages/verse-core/src/db/rewriter.ts:139


visitExists()

visitExists(exists: SqlExists): SqlNode

Parameters

ParameterType
existsSqlExists

Returns

SqlNode

Overrides

SqlVisitor.visitExists

Defined in

packages/verse-core/src/db/rewriter.ts:89


visitForeignKey()

visitForeignKey(foreignKey: SqlForeignKey): SqlNode

Parameters

ParameterType
foreignKeySqlForeignKey

Returns

SqlNode

Overrides

SqlVisitor.visitForeignKey

Defined in

packages/verse-core/src/db/rewriter.ts:294


visitFunction()

visitFunction(func: SqlFunction): SqlNode

Parameters

ParameterType
funcSqlFunction

Returns

SqlNode

Overrides

SqlVisitor.visitFunction

Defined in

packages/verse-core/src/db/rewriter.ts:209


visitIdentifier()

visitIdentifier(identifier: SqlIdentifier): SqlNode

Parameters

ParameterType
identifierSqlIdentifier

Returns

SqlNode

Overrides

SqlVisitor.visitIdentifier

Defined in

packages/verse-core/src/db/rewriter.ts:199


visitIn()

visitIn(_in: SqlIn): SqlNode

Parameters

ParameterType
_inSqlIn

Returns

SqlNode

Overrides

SqlVisitor.visitIn

Defined in

packages/verse-core/src/db/rewriter.ts:94


visitInsert()

visitInsert(insert: SqlInsert): SqlNode

Parameters

ParameterType
insertSqlInsert

Returns

SqlNode

Overrides

SqlVisitor.visitInsert

Defined in

packages/verse-core/src/db/rewriter.ts:214


visitIsNotNull()

visitIsNotNull(isNotNull: SqlIsNotNull): SqlNode

Parameters

ParameterType
isNotNullSqlIsNotNull

Returns

SqlNode

Overrides

SqlVisitor.visitIsNotNull

Defined in

packages/verse-core/src/db/rewriter.ts:284


visitIsNull()

visitIsNull(isNull: SqlIsNull): SqlNode

Parameters

ParameterType
isNullSqlIsNull

Returns

SqlNode

Overrides

SqlVisitor.visitIsNull

Defined in

packages/verse-core/src/db/rewriter.ts:279


visitJoin()

visitJoin(join: SqlJoin): SqlNode

Parameters

ParameterType
joinSqlJoin

Returns

SqlNode

Overrides

SqlVisitor.visitJoin

Defined in

packages/verse-core/src/db/rewriter.ts:229


visitLike()

visitLike(like: SqlLike): SqlNode

Parameters

ParameterType
likeSqlLike

Returns

SqlNode

Overrides

SqlVisitor.visitLike

Defined in

packages/verse-core/src/db/rewriter.ts:99


visitMember()

visitMember(member: SqlMember): SqlNode

Parameters

ParameterType
memberSqlMember

Returns

SqlNode

Overrides

SqlVisitor.visitMember

Defined in

packages/verse-core/src/db/rewriter.ts:244


visitNegation()

visitNegation(negation: SqlNegation): SqlNode

Parameters

ParameterType
negationSqlNegation

Returns

SqlNode

Overrides

SqlVisitor.visitNegation

Defined in

packages/verse-core/src/db/rewriter.ts:109


visitNextValue()

visitNextValue(nextValue: SqlNextValue): SqlNode

Parameters

ParameterType
nextValueSqlNextValue

Returns

SqlNode

Overrides

SqlVisitor.visitNextValue

Defined in

packages/verse-core/src/db/rewriter.ts:204


visitNode()

visitNode(node: SqlNode): SqlNode

Parameters

ParameterType
nodeSqlNode

Returns

SqlNode

Overrides

SqlVisitor.visitNode

Defined in

packages/verse-core/src/db/rewriter.ts:62


visitNot()

visitNot(not: SqlNot): SqlNode

Parameters

ParameterType
notSqlNot

Returns

SqlNode

Overrides

SqlVisitor.visitNot

Defined in

packages/verse-core/src/db/rewriter.ts:114


visitNotLike()

visitNotLike(notLike: SqlNotLike): SqlNode

Parameters

ParameterType
notLikeSqlNotLike

Returns

SqlNode

Overrides

SqlVisitor.visitNotLike

Defined in

packages/verse-core/src/db/rewriter.ts:104


visitNull()

visitNull(nul: SqlNull): SqlNode

Parameters

ParameterType
nulSqlNull

Returns

SqlNode

Overrides

SqlVisitor.visitNull

Defined in

packages/verse-core/src/db/rewriter.ts:274


visitNumber()

visitNumber(n: SqlNumber): SqlNode

Parameters

ParameterType
nSqlNumber

Returns

SqlNode

Overrides

SqlVisitor.visitNumber

Defined in

packages/verse-core/src/db/rewriter.ts:249


visitOrderBy()

visitOrderBy(orderBy: SqlOrderBy): SqlNode

Parameters

ParameterType
orderBySqlOrderBy

Returns

SqlNode

Overrides

SqlVisitor.visitOrderBy

Defined in

packages/verse-core/src/db/rewriter.ts:234


visitOrdering()

visitOrdering(ordering: SqlOrdering): SqlNode

Parameters

ParameterType
orderingSqlOrdering

Returns

SqlNode

Overrides

SqlVisitor.visitOrdering

Defined in

packages/verse-core/src/db/rewriter.ts:239


visitParameter()

visitParameter(parameter: SqlParameter): SqlNode

Parameters

ParameterType
parameterSqlParameter

Returns

SqlNode

Overrides

SqlVisitor.visitParameter

Defined in

packages/verse-core/src/db/rewriter.ts:259


visitRaw()

visitRaw(raw: SqlRaw): SqlNode

Parameters

ParameterType
rawSqlRaw

Returns

SqlNode

Overrides

SqlVisitor.visitRaw

Defined in

packages/verse-core/src/db/rewriter.ts:309


visitRenameColumn()

visitRenameColumn(renameColumn: SqlRenameColumn): SqlNode

Parameters

ParameterType
renameColumnSqlRenameColumn

Returns

SqlNode

Overrides

SqlVisitor.visitRenameColumn

Defined in

packages/verse-core/src/db/rewriter.ts:189


visitRenameTable()

visitRenameTable(renameTable: SqlRenameTable): SqlNode

Parameters

ParameterType
renameTableSqlRenameTable

Returns

SqlNode

Overrides

SqlVisitor.visitRenameTable

Defined in

packages/verse-core/src/db/rewriter.ts:144


visitSelect()

visitSelect(select: SqlSelect): SqlNode

Parameters

ParameterType
selectSqlSelect

Returns

SqlNode

Overrides

SqlVisitor.visitSelect

Defined in

packages/verse-core/src/db/rewriter.ts:264


visitSet()

visitSet(set: SqlSet): SqlNode

Parameters

ParameterType
setSqlSet

Returns

SqlNode

Overrides

SqlVisitor.visitSet

Defined in

packages/verse-core/src/db/rewriter.ts:69


visitStar()

visitStar(star: SqlStar): SqlNode

Parameters

ParameterType
starSqlStar

Returns

SqlNode

Overrides

SqlVisitor.visitStar

Defined in

packages/verse-core/src/db/rewriter.ts:269


visitString()

visitString(str: SqlString): SqlNode

Parameters

ParameterType
strSqlString

Returns

SqlNode

Overrides

SqlVisitor.visitString

Defined in

packages/verse-core/src/db/rewriter.ts:299


visitTimestamp()

visitTimestamp(timestamp: SqlTimestamp): SqlNode

Parameters

ParameterType
timestampSqlTimestamp

Returns

SqlNode

Overrides

SqlVisitor.visitTimestamp

Defined in

packages/verse-core/src/db/rewriter.ts:304


visitTypeAlias()

visitTypeAlias(typeAlias: SqlTypeAlias): SqlNode

Parameters

ParameterType
typeAliasSqlTypeAlias

Returns

SqlNode

Overrides

SqlVisitor.visitTypeAlias

Defined in

packages/verse-core/src/db/rewriter.ts:79


visitUpdate()

visitUpdate(update: SqlUpdate): SqlNode

Parameters

ParameterType
updateSqlUpdate

Returns

SqlNode

Overrides

SqlVisitor.visitUpdate

Defined in

packages/verse-core/src/db/rewriter.ts:219