Table of Contents

Class: ISQLWriter ./src/peak/query/interfaces.py

A smart stream used to create SQL statements

Base Classes   
Interface
Methods   
assignAlias
assignAliasesFor
getAlias
namedParam
prepender
separator
write
writeAlias
writeCond
writeExpr
writeSelect
writeTable
  assignAlias 
assignAlias ( rv )

XXX

  assignAliasesFor 
assignAliasesFor ( rvs )

XXX

  getAlias 
getAlias ( rv )

XXX

  namedParam 
namedParam ( param )

Add the parameter object to the statement being written

  prepender 
prepender ( prefix )

Return a new ISQLWriter that will write prefix before any output

This method is used when writing optional WHERE/HAVING clauses, by obtaining a new writer with e.g.:

            writer.prepender(" WHERE ").writeCond(someCondition)

If the new writer has any text written to it, it will write the prefix once, before any subsequent output. Note that you should not mix use of the new writer with use of the old writer. Once you're done with the new writer, throw it away and go back to the previous writer.

  separator 
separator ( sep )

Return a callable that writes a separator (except first time)

This method is used for writing comma-separated lists, or lists of AND/OR expressions, e.g.:

            sep = writer.separator(', ')
            for item in someExprs:
                sep()
                writer.writeExpr(item)

The callable returned by this method will not write the separator the first time it's called, so that the separator will only be written between items. Note that this means you must call this method to get a new separator callable for each list you want to output.

  write 
write ( text )

Write text to the SQL output

  writeAlias 
writeAlias ( RV )

Write RV as an SQL table alias (e.g. the F1 in F1.Bar)

  writeCond 
writeCond ( ob )

Write ob as an SQL condition

  writeExpr 
writeExpr ( ob )

Write ob as an SQL expression

  writeSelect 
writeSelect ( ob )

Write ob as an SQL SELECT statement

  writeTable 
writeTable ( RV )

Write RV as an SQL table reference (e.g. "Foo AS F1")


Table of Contents

This document was automatically generated on Mon Apr 22 01:11:03 2024 by HappyDoc version 2.1