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.SqlParser
object
- 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.Batch
object which contains all theGda.Statement
objects created while parsing (one object per SQL statement).filename's contents are parsed and
Gda.Statement
objects 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 andNone
is returnedif sql is
None
, then the returnedGda.Batch
object will contain no statement.
- parse_string(sql)¶
- Parameters:
sql (
str
) – the SQL string to parse- Raises:
- Returns:
a new
Gda.Statement
object, orNone
if 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.Statement
orNone
, remain:str
)
Parses sql and creates a
Gda.Statement
statement 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.Batch
object, orNone
if 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.Batch
object which contains all theGda.Statement
objects 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.Statement
objects 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 nonNone
pointer, error may be set, andNone
is returned.if sql is
None
, then the returnedGda.Batch
object 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()¶