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
Inherited from
Methods
beforeVisit()
protected
beforeVisit(node
:SqlNode
):void
Parameters
Parameter | Type |
---|---|
node | SqlNode |
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
Parameter | Type |
---|---|
list ? | List <T > |
Returns
undefined
| List
<T
>
Defined in
packages/verse-core/src/db/rewriter.ts:323
rewriteProjection()
Parameters
Parameter | Type |
---|---|
projection | SqlNode |
Returns
Defined in
packages/verse-core/src/db/rewriter.ts:319
visitAddColumn()
visitAddColumn(
addColumn
:SqlAddColumn
):SqlNode
Parameters
Parameter | Type |
---|---|
addColumn | SqlAddColumn |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:169
visitAddForeignKey()
visitAddForeignKey(
addConstraint
:SqlAddForeignKey
):SqlNode
Parameters
Parameter | Type |
---|---|
addConstraint | SqlAddForeignKey |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:289
visitAddPrimaryKey()
visitAddPrimaryKey(
addPrimaryKey
:SqlAddPrimaryKey
):SqlAddPrimaryKey
Parameters
Parameter | Type |
---|---|
addPrimaryKey | SqlAddPrimaryKey |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:179
visitAlias()
Parameters
Parameter | Type |
---|---|
alias | SqlAlias |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:74
visitAlterColumn()
visitAlterColumn(
alterColumn
:SqlAlterColumn
):SqlNode
Parameters
Parameter | Type |
---|---|
alterColumn | SqlAlterColumn |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:174
visitBinary()
Parameters
Parameter | Type |
---|---|
binary | SqlBinary |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:84
visitBoolean()
visitBoolean(
boolean
:SqlBoolean
):SqlNode
Parameters
Parameter | Type |
---|---|
boolean | SqlBoolean |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:254
visitCase()
Parameters
Parameter | Type |
---|---|
cas | SqlCase |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:314
visitColumn()
Parameters
Parameter | Type |
---|---|
column | SqlColumn |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:194
visitComposite()
visitComposite(
composite
:SqlComposite
):SqlNode
Parameters
Parameter | Type |
---|---|
composite | SqlComposite |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:119
visitCreateDatabase()
visitCreateDatabase(
createDatabase
:SqlCreateDatabase
):SqlNode
Parameters
Parameter | Type |
---|---|
createDatabase | SqlCreateDatabase |
Returns
Overrides
SqlVisitor
.visitCreateDatabase
Defined in
packages/verse-core/src/db/rewriter.ts:124
visitCreateIndex()
visitCreateIndex(
createIndex
:SqlCreateIndex
):SqlNode
Parameters
Parameter | Type |
---|---|
createIndex | SqlCreateIndex |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:159
visitCreateSequence()
visitCreateSequence(
createSequence
:SqlCreateSequence
):SqlNode
Parameters
Parameter | Type |
---|---|
createSequence | SqlCreateSequence |
Returns
Overrides
SqlVisitor
.visitCreateSequence
Defined in
packages/verse-core/src/db/rewriter.ts:149
visitCreateTable()
visitCreateTable(
createTable
:SqlCreateTable
):SqlCreateTable
Parameters
Parameter | Type |
---|---|
createTable | SqlCreateTable |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:134
visitDelete()
Parameters
Parameter | Type |
---|---|
_delete | SqlDelete |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:224
visitDropColumn()
visitDropColumn(
dropColumn
:SqlDropColumn
):SqlNode
Parameters
Parameter | Type |
---|---|
dropColumn | SqlDropColumn |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:184
visitDropDatabase()
visitDropDatabase(
dropDatabase
:SqlDropDatabase
):SqlNode
Parameters
Parameter | Type |
---|---|
dropDatabase | SqlDropDatabase |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:129
visitDropIndex()
visitDropIndex(
dropIndex
:SqlDropIndex
):SqlNode
Parameters
Parameter | Type |
---|---|
dropIndex | SqlDropIndex |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:164
visitDropSequence()
visitDropSequence(
dropSequence
:SqlDropSequence
):SqlNode
Parameters
Parameter | Type |
---|---|
dropSequence | SqlDropSequence |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:154
visitDropTable()
visitDropTable(
dropTable
:SqlDropTable
):SqlNode
Parameters
Parameter | Type |
---|---|
dropTable | SqlDropTable |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:139
visitExists()
Parameters
Parameter | Type |
---|---|
exists | SqlExists |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:89
visitForeignKey()
visitForeignKey(
foreignKey
:SqlForeignKey
):SqlNode
Parameters
Parameter | Type |
---|---|
foreignKey | SqlForeignKey |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:294
visitFunction()
visitFunction(
func
:SqlFunction
):SqlNode
Parameters
Parameter | Type |
---|---|
func | SqlFunction |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:209
visitIdentifier()
visitIdentifier(
identifier
:SqlIdentifier
):SqlNode
Parameters
Parameter | Type |
---|---|
identifier | SqlIdentifier |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:199
visitIn()
Parameters
Parameter | Type |
---|---|
_in | SqlIn |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:94
visitInsert()
Parameters
Parameter | Type |
---|---|
insert | SqlInsert |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:214
visitIsNotNull()
visitIsNotNull(
isNotNull
:SqlIsNotNull
):SqlNode
Parameters
Parameter | Type |
---|---|
isNotNull | SqlIsNotNull |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:284
visitIsNull()
Parameters
Parameter | Type |
---|---|
isNull | SqlIsNull |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:279
visitJoin()
Parameters
Parameter | Type |
---|---|
join | SqlJoin |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:229
visitLike()
Parameters
Parameter | Type |
---|---|
like | SqlLike |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:99
visitMember()
Parameters
Parameter | Type |
---|---|
member | SqlMember |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:244
visitNegation()
visitNegation(
negation
:SqlNegation
):SqlNode
Parameters
Parameter | Type |
---|---|
negation | SqlNegation |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:109
visitNextValue()
visitNextValue(
nextValue
:SqlNextValue
):SqlNode
Parameters
Parameter | Type |
---|---|
nextValue | SqlNextValue |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:204
visitNode()
Parameters
Parameter | Type |
---|---|
node | SqlNode |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:62
visitNot()
Parameters
Parameter | Type |
---|---|
not | SqlNot |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:114
visitNotLike()
visitNotLike(
notLike
:SqlNotLike
):SqlNode
Parameters
Parameter | Type |
---|---|
notLike | SqlNotLike |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:104
visitNull()
Parameters
Parameter | Type |
---|---|
nul | SqlNull |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:274
visitNumber()
Parameters
Parameter | Type |
---|---|
n | SqlNumber |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:249
visitOrderBy()
visitOrderBy(
orderBy
:SqlOrderBy
):SqlNode
Parameters
Parameter | Type |
---|---|
orderBy | SqlOrderBy |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:234
visitOrdering()
visitOrdering(
ordering
:SqlOrdering
):SqlNode
Parameters
Parameter | Type |
---|---|
ordering | SqlOrdering |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:239
visitParameter()
visitParameter(
parameter
:SqlParameter
):SqlNode
Parameters
Parameter | Type |
---|---|
parameter | SqlParameter |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:259
visitRaw()
Parameters
Parameter | Type |
---|---|
raw | SqlRaw |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:309
visitRenameColumn()
visitRenameColumn(
renameColumn
:SqlRenameColumn
):SqlNode
Parameters
Parameter | Type |
---|---|
renameColumn | SqlRenameColumn |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:189
visitRenameTable()
visitRenameTable(
renameTable
:SqlRenameTable
):SqlNode
Parameters
Parameter | Type |
---|---|
renameTable | SqlRenameTable |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:144
visitSelect()
Parameters
Parameter | Type |
---|---|
select | SqlSelect |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:264
visitSet()
Parameters
Parameter | Type |
---|---|
set | SqlSet |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:69
visitStar()
Parameters
Parameter | Type |
---|---|
star | SqlStar |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:269
visitString()
Parameters
Parameter | Type |
---|---|
str | SqlString |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:299
visitTimestamp()
visitTimestamp(
timestamp
:SqlTimestamp
):SqlNode
Parameters
Parameter | Type |
---|---|
timestamp | SqlTimestamp |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:304
visitTypeAlias()
visitTypeAlias(
typeAlias
:SqlTypeAlias
):SqlNode
Parameters
Parameter | Type |
---|---|
typeAlias | SqlTypeAlias |
Returns
Overrides
Defined in
packages/verse-core/src/db/rewriter.ts:79
visitUpdate()
Parameters
Parameter | Type |
---|---|
update | SqlUpdate |