Package ais :: Module sqlhelp :: Class insert
[hide private]
[frames] | no frames]

Class insert

source code

Help create an SQL insert statement for injecting data into a database. Wee!


To Do:
Instance Methods [hide private]
 
__init__(self, table, dbType='postgres')
Create an insert with no values
source code
 
dump(self)
Print out a safer dump to std out rather than str for debugging
source code
 
__str__(self)
Return the SQL string for the insert
source code
 
addPostGIS(self, field, value)
Handle postGIS geometry
source code
 
add(self, field, value)
Add a field value pair to the insert
source code
Method Details [hide private]

__init__(self, table, dbType='postgres')
(Constructor)

source code 
Create an insert with no values
Parameters:
  • table - which table are we going to insert into
  • dbType - sqlite can not handle True/False keyworks (at version 3.2.8)

add(self, field, value)

source code 
Add a field value pair to the insert
Parameters:
  • field - name of the field
  • value - value to be assigned to that field.

Note: Integers and floats should NOT be converted to strings.