SqlStatement

This structure is the top level structure encapsulating several type of statements.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(gda.types.SqlStatementType type)

Use this function to create a #GdaSqlStatement of the specified type type.

Members

Functions

_cPtr
void* _cPtr(Flag!"Dup" dup)
checkClean
void checkClean()

Cleans any data set by a previous call to gda.sql_statement.SqlStatement.checkValidity.

checkStructure
bool checkStructure()

Checks for any error in stmt's structure to make sure the statement is valid (for example a SELECT statement must at least return a column, a DELETE statement must specify which table is targeted).

checkValidity
bool checkValidity(gda.connection.Connection cnc)

If cnc is not null, then checks that all the database objects referenced in the statement actually exist in the connection's database (for example the table being updated in a UPDATE statement must exist in the connection's database for the check to succeed). This method fills the stmt->validity_meta_struct attribute.

checkValidityM
bool checkValidityM(gda.meta_struct.MetaStruct mstruct)

If mstruct is not null, then checks that all the database objects referenced in the statement i actually referenced in mstruct (for example the table being updated in a UPDATE statement must exist in the connection's database for the check to succeed). This method sets the stmt->validity_meta_struct attribute to mstruct.

compoundSetType
void compoundSetType(gda.types.SqlStatementCompoundType type)

Specifies stmt's type of compound

compoundTakeStmt
void compoundTakeStmt(gda.sql_statement.SqlStatement s)

Adds the s sub-statement to the stmt compound statement. s's reference is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

copy
gda.sql_statement.SqlStatement copy()

Creates a copy of stmt.

deleteTakeTableName
void deleteTakeTableName(gobject.value.Value value)

Sets the name of the table to delete from in stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

insertTakeOnConflict
void insertTakeOnConflict(gobject.value.Value value)

Sets the name of the resolution conflict algorithm used by stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

insertTakeSelect
void insertTakeSelect(gda.sql_statement.SqlStatement select)

Specifies a SELECT statement, the values inserted will be the result set of select. select's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

insertTakeTableName
void insertTakeTableName(gobject.value.Value value)

Sets the name of the table to insert into in stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

normalize
bool normalize(gda.connection.Connection cnc)

"Normalizes" (in place) some parts of stmt, which means stmt may be modified. At the moment any "*" field in a SELECT statement will be replaced by one #GdaSqlSelectField structure for each field in the referenced table.

self
SqlStatement self()

Returns this, for use in with statements.

serialize
string serialize()

Creates a string representation of stmt.

transSetIsolLevel
void transSetIsolLevel(gda.types.TransactionIsolation level)
transTakeMode
void transTakeMode(gobject.value.Value value)

Sets the model of the transaction

transTakeName
void transTakeName(gobject.value.Value value)

Sets the name of the transaction

updateTakeOnConflict
void updateTakeOnConflict(gobject.value.Value value)

Sets the name of the resolution conflict algorithm used by stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

updateTakeTableName
void updateTakeTableName(gobject.value.Value value)

Sets the name of the table to delete from in stmt.

Properties

_gType
GType _gType [@property getter]
sql
string sql [@property getter]
sql
string sql [@property setter]
stmtType
gda.types.SqlStatementType stmtType [@property getter]

Get stmtType field.

stmtType
gda.types.SqlStatementType stmtType [@property setter]

Set stmtType field.

validityMetaStruct
gda.meta_struct.MetaStruct validityMetaStruct [@property getter]
validityMetaStruct
gda.meta_struct.MetaStruct validityMetaStruct [@property setter]

Static functions

_getGType
GType _getGType()
stringToType
gda.types.SqlStatementType stringToType(string type)

Converts a string to a #GdaSqlStatementType value, see also gda.sql_statement.SqlStatement.typeToString

typeToString
string typeToString(gda.types.SqlStatementType type)

Converts a #GdaSqlStatementType to a string, see also gda.sql_statement.SqlStatement.stringToType

Inherited Members

From Boxed

_cInstancePtr
void* _cInstancePtr;

Pointer to the C boxed value

_getGType
GType _getGType()

Get the GType of this boxed type.

_gType
GType _gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

boxCopy
void* boxCopy()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.