Menu

pyDaSSQLiteMan App Comment Commands

adepoch

pyDaSSQLiteMan V2.17 introduces application controlling commands which can be placed in comments, in a form of XML tags. The following abilities can be used from these commands:

  1. Connecting to a database
  2. Disconnecting from a database
  3. Importing a file into the database as a table
  4. Exporting a table or view from the database into a file
  5. Committing a database connection
  6. Rolling back a database connection
  7. Changing the Python/Sqlite isolation level for database connections
  8. Exiting the application

Here are examples of each type of command (note that they are presented as SQL single or multiline comments containing XML. Ommitting some tags for details will cause default values to be used):

--<application_command commandtype="connect">c:\mydb.sqlite</application_command>

To connect to an in memory database use

--<application_command commandtype="connect">:memory:</application_command>
--<application_command commandtype="disconnect" />
--<application_command commandtype="commit" />
--<application_command commandtype="rollback" />
--<application_command commandtype="isolationlevel">deferred</application_command>

(The valid values for the isolation level are 'none', 'deferred', 'immediate', 'exclusive' and 'default'. Leaving the value blank is the same as nominating 'none').

/*<application_command commandtype="import">
<application_command_detail name="filename">c:\myfile.csv</application_command_detail>
<application_command_detail name="textcharacter">&quot;</application_command_detail>
<application_command_detail name="containsheader">true</application_command_detail>
<application_command_detail name="delimiter">,</application_command_detail>
<application_command_detail name="tablename">MY_FILE</application_command_detail>
<application_command_detail name="commitcount">500</application_command_detail>
<application_command_detail name="encoding">utf-8</application_command_detail>
<application_command_detail name="maxfieldsize">32000</application_command_detail>
<application_command_detail name="datatypes">scan</application_command_detail>
<application_command_detail name="zerolengthstringsnull">true</application_command_detail>
</application_command>*/

(The valid values for data types are 'scan' or 'text'. An alternative name for datatypes is 'fieldnomination'. The valid values for zerolengthstringsnull are 'true' or 'false').

/*<application_command commandtype="export">
<application_command_detail name="filename">C:\ExportFile.csv</application_command_detail>
<application_command_detail name="tablename">analysis_StandardAddressListPrevNotInCurr</application_command_detail>
<application_command_detail name="textcharacter">&quot;</application_command_detail>
<application_command_detail name="containsheader">true</application_command_detail>
<application_command_detail name="delimiter">,</application_command_detail>
<application_command_detail name="encoding">utf-8</application_command_detail>
</application_command>*/
--<application_command commandtype="exit" />

Related

Wiki: General Help

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.