SqlBuilder Supported SQL Reference
The reference below attempts to enumerate most of the SQL syntax
supported by SqlBuilder, although it is not exhaustive.
General Notes
Almost every method has a "custom" variation which supports
inserting more complicated objects in place of the more common
ones. The custom variation will often handle a range of Object
types automatically.
Most constructors which take an enum value have a named static
method for constructing the object with each enum value.
Queries
DDL Queries
CreateTableQuery
|
- CREATE TABLE <tableName> (<column> [ <columnConstraint> ], ...)
- [ TABLESPACE <tableSpace> ]
|
CreateIndexQuery [1]
|
- CREATE INDEX <indexName> ON <table> (<column>, ...)
- [ TABLESPACE <tableSpace> ]
|
CreateViewQuery
|
- CREATE VIEW [ <viewName> (<column>, ...) ]
- AS <selectQuery>
- [ WITH CHECK OPTION ]
|
AlterTableQuery
|
- ALTER TABLE <table> <action>
|
DropQuery
|
- DROP <objType> <objName> [ <behavior> ]
|
GrantQuery
|
- GRANT <privilege>, ... ON <target> TO <grantee>, ... [ WITH GRANT OPTION ]
|
RevokeQuery
|
- REVOKE <privilege>, ... ON <target> FROM <grantee>, ... [ <behavior> ]
|
DML Queries
SelectQuery
|
- SELECT [ DISTINCT ] <column>, ...
- FROM [ <join>, ... ] | [ <table>, ... ]
- [ WHERE <condition> ]
- [ GROUP BY <group>, ...
- [ HAVING <havingCondition> ] ]
- [ ORDER BY <ordering> [ <orderingDir> ], ... ]
- [ FOR UPDATE ]
|
InsertQuery
|
- INSERT INTO <table> ( <column>, ... ) VALUES ( <value>, ... )
|
InsertSelectQuery
|
- INSERT INTO <table> ( <column>, ... ) <selectQuery>
|
DeleteQuery
|
- DELETE FROM <table>
- [ WHERE <condition> ]
|
UnionQuery
|
- <selectQuery> UNION [ ALL ] <selectQuery> ...
- [ ORDER BY <ordering> [ <orderingDir> ], ... ]
|
UpdateQuery
|
- UPDATE <table> SET <column> = <value>, ...
- [ WHERE <condition> ]
|
Subquery
|
|
Clauses
Conditions
Condition objects represent boolean clauses. All conditions have logic for
determining whether or not they actually contain any content and
will not write anything to the generated query if they consider
themselves empty.
Expressions
Expression objects represent value clauses. All expressions have similar
logic to Conditions for handling empty
content.
- [1]
- This syntax is not ANSI SQL92 compliant.