Gda.Statement¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Gets emitted whenever the structure and contents of the statement have been verified (emitted after |
|
Gets emitted whenever the statement has changed |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
object |
r |
Class Details¶
- class Gda.Statement(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
the new object
- Return type:
Creates a new
Gda.Statementobject
- check_structure()¶
- Raises:
- Returns:
Trueif self's structure is correct- Return type:
Checks that self's structure is correct.
- check_validity(cnc)¶
- Parameters:
cnc (
Gda.ConnectionorNone) – aGda.Connectionobject, orNone- Raises:
- Returns:
Trueif every object actually exists in cnc's database- Return type:
If cnc is not
Nonethen checks that every object (table, field, function) used in self actually exists in cnc's databaseIf cnc is
None, then cleans anything related to cnc in self.See gda_sql_statement_check_validity() for more information.
- copy()¶
- Returns:
a the new copy of self
- Return type:
Copy constructor
- get_parameters()¶
- Raises:
- Returns:
Trueif no error occurred.- Return type:
Get a new
Gda.Setobject which groups all the execution parameters which self needs. This new object is returned though out_params.Note that if self does not need any parameter, then out_params is set to
None.
- get_statement_type()¶
- Returns:
the statement type
- Return type:
Get the type of statement held by self. It returns
Gda.SqlStatementType.NONEif self does not hold any statement
- is_useless()¶
-
Tells if self is composed only of spaces (that is it has no real SQL code), and is completely useless as such.
- normalize(cnc)¶
- Parameters:
cnc (
Gda.Connection) – aGda.Connectionobject- Raises:
- Returns:
Trueif no error occurred- Return type:
“Normalizes” some parts of self, see gda_sql_statement_normalize() for more information.
- serialize()¶
- Returns:
a string containing the serialized version of self
- Return type:
Creates a string representing the contents of self.
- to_sql_extended(cnc, params, flags)¶
- Parameters:
cnc (
Gda.ConnectionorNone) – aGda.Connectionobject, orNoneparams (
Gda.SetorNone) – parameters contained in a singleGda.Setobject, orNoneflags (
Gda.StatementSqlFlag) – a set of flags to control the rendering
- Raises:
- Returns:
a new string if no error occurred
- params_used:
a place to store the list of actual
Gda.Holderobjects in params used to do the rendering, orNone
- Return type:
(
str, params_used: [Gda.Holder])
Renders self as an SQL statement, with some control on how it is rendered.
If cnc is not
None, then the rendered SQL will better be suited to be used by cnc (in particular it may include some SQL tweaks and/or proprietary extensions specific to the database engine used by cnc): in this case the result is similar to callingGda.Connection.statement_to_sql().
- to_sql_real(context)¶
- Parameters:
context (
Gda.SqlRenderingContext) – aGda.SqlRenderingContextcontext- Raises:
- Returns:
a new string, or
Noneif an error occurred- Return type:
Renders self to its SQL representation, using context to specify how each part of self must be rendered. This function is mainly used by database provider’s implementations which require to specialize some aspects of SQL rendering to be adapted to the database,’s own SQL dialect (for example SQLite rewrites the ‘
False' and ‘True' literals as ‘0’ and ‘NOT 0’).
- do_checked(cnc, checked) virtual¶
- Parameters:
cnc (
Gda.Connection) –checked (
bool) –
- do_reset() virtual¶
Signal Details¶
- Gda.Statement.signals.checked(statement, object, p0)¶
- Signal Name:
checked- Flags:
- Parameters:
statement (
Gda.Statement) – The object which received the signalobject (
Gda.Connection) –p0 (
bool) –
Gets emitted whenever the structure and contents of the statement have been verified (emitted after
Gda.Statement.check_validity()).
- Gda.Statement.signals.reset(statement)¶
- Signal Name:
reset- Flags:
- Parameters:
statement (
Gda.Statement) – The object which received the signal
Gets emitted whenever the statement has changed