Gda.SqlParser¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
|||
r |
|||
r/w |
|||
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
object |
r |
Class Details¶
- class Gda.SqlParser(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
the new object
- Return type:
Creates a new
Gda.SqlParserobject
- parse_file_as_batch(filename)¶
- Parameters:
filename (
str) – name of the file to parse- Raises:
- Returns:
- Return type:
Parse filename's contents and creates a
Gda.Batchobject which contains all theGda.Statementobjects created while parsing (one object per SQL statement).filename's contents are parsed and
Gda.Statementobjects are created as long as no error is found. If an error is found at some point, then the parsing stops, error may be set andNoneis returnedif sql is
None, then the returnedGda.Batchobject will contain no statement.
- parse_string(sql)¶
- Parameters:
sql (
str) – the SQL string to parse- Raises:
- Returns:
a new
Gda.Statementobject, orNoneif an error occurred- remain:
location to store a pointer to remaining part of sql in case sql has multiple statement, or
None
- Return type:
(
Gda.StatementorNone, remain:str)
Parses sql and creates a
Gda.Statementstatement from the first SQL statement contained in sql: if sql contains more than one statement, then the remaining part of the string is not parsed at all, and remain (if notNone) will point at the first non parsed character.To include variables in the sql string, see the
‘GdaSqlParser’s object description [GdaSqlParser.description]’.
- parse_string_as_batch(sql)¶
- Parameters:
sql (
str) – the SQL string to parse- Raises:
- Returns:
a new
Gda.Batchobject, orNoneif an error occurred- remain:
location to store a pointer to remaining part of sql in case an error occurred while parsing sql, or
None
- Return type:
Parse sql and creates a
Gda.Batchobject which contains all theGda.Statementobjects created while parsing (one object per SQL statement). Empty statements (composed of spaces only) do not appear in the resulting object.sql is parsed and
Gda.Statementobjects are created as long as no error is found in sql. If an error is found at some point, then the parsing stops and remain may contain a nonNonepointer, error may be set, andNoneis returned.if sql is
None, then the returnedGda.Batchobject will contain no statement.To include variables in the sql string, see the
‘GdaSqlParser’s object description [GdaSqlParser.description]’.
- set_overflow_error()¶
- set_syntax_error()¶