<< Click to Display Table of Contents >> SQLite Database Server |
|
The interface provides access to aMG SQLite Database Server board via http GET method. Build and download model webserver_demo.mdl to target for below demo.
Syntax: /sqlite.cgi?<arg1>=<arg1_value>&<arg2>=<arg2_value>&<arg3>=<arg3_value>&...
Name |
Value |
Description |
action |
getinfo | query |
This argument is optional, default is 'query' if not specified. getinfo - get hardware board information (Firmware version and library version). query - input sqlite query statement. Usage example: |
query |
<query string> |
This argument cannot be empty if argument action=query. Usage example: |
mode |
csv | column | html | insert | line | list | tabs | tcl |
This argument equivalent to .mode <mode> in sqlite command line. Usage example: http://192.168.1.41/sqlite.cgi?query=select * from sensors limit 50&mode=csv |
header |
on | off |
This argument equivalent to .header <on|off> in sqlite command line. If this argument not specified, default is 'on' Usage example: http://192.168.1.41/sqlite.cgi?query=select * from sensors limit 50&mode=csv&header=on |
db |
<database file name> |
Specify database file name. If this argument not specified, default is 'database.db'. |
output |
<sqlite query output to file> | sqlite_query.html |
This argument ask server to save output of query to file to directory 'system', and also response to web browser the same file. Usage example: Then request output file (stored in directory 'system'): http://192.168.1.41/system/sql.csv
Note: sqlite_query.html is reserved for demo of query form. |
Query: http://192.168.1.41/sqlite.cgi?action=getinfo
Response:
Query: http://192.168.1.41/sqlite.cgi?query=select%20*%20from%20sensors%20limit%2010&mode=csv
Response:
The CGI accept GET method, user may create html form for input query string.
Query:
http://192.168.1.41/sqlite.cgi?query=.version&output=sqlite_query.html&mode=csv&db=database.db
Response:
Try enter some query string and Submit:
1. Length of sqlite is limit. Due to using GET method for sqlite.cgi, HTTP request line limit to 1023 character.
2. SQLite output size is limit to 8k bytes maximum.