Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Bulk query SQLite database over the network.
Way faster than SQLiteProxy!

CircleCI Coverage Status Go Report Card


  • Download a precompiled binary from

  • Or use go get:

    go get -u

    This package uses Compilation errors might be resolved by reading

  • Or use Ubuntu PPA:

    curl -SsL | sudo apt-key add -
    sudo curl -SsL -o /etc/apt/sources.list.d/assafmo.list
    sudo apt update
    sudo apt install sqlitequeryserver


Usage of SQLiteQueryServer:
  -db string
        Filesystem path of the SQLite database
  -port uint
        HTTP port to listen on (default 80)
  -query string
        SQL query to prepare for

Note: SQLiteQueryServer is optimized for the SELECT command. Other commands such as INSERT, UPDATE, DELETE, CREATE, etc might be slow because SQLiteQueryServer doesn't use transactions (yet). Also, the response format and error messages from these commands may be odd or unexpected.


Creating a server

SQLiteQueryServer --db "$DB_PATH" --query "$PARAMETERIZED_SQL_QUERY" --port "$PORT"
SQLiteQueryServer --db ./test_db/ip_dns.db --query "SELECT * FROM ip_dns WHERE dns = ?" --port 8080

This will expose the ./test_db/ip_dns.db database with the query SELECT * FROM ip_dns WHERE dns = ? on port 8080.
Requests will need to provide the query parameters.

Querying the server

echo -e "\\" | curl "http://localhost:8080/query" --data-binary @-
echo -e "$QUERY1_PARAM1,$QUERY1_PARAM2\n$QUERY2_PARAM1,$QUERY2_PARAM2" | curl "http://$ADDRESS:$PORT/query" --data-binary @-
curl "http://$ADDRESS:$PORT/query" -d "$PARAM_1,$PARAM_2,...,$PARAM_N"
  • Request must be a HTTP POST to "http://$ADDRESS:$PORT/query".
  • Request body must be a valid CSV.
  • Request body must not have a CSV header.
  • Each request body line is a different query.
  • Each param in a line corresponds to a query param (a question mark in the query string).
  • Static query (without any query params):
    • The request must be a HTTP GET to "http://$ADDRESS:$PORT/query".
    • The query executes only once.

Getting a response

echo -e "\\" | curl "http://localhost:8080/query" --data-binary @-
    "in": [""],
    "headers": ["ip", "dns"],
    "out": [["", ""], ["", ""]]
    "in": [""],
    "headers": ["ip", "dns"],
    "out": [["", ""]]
    "in": [""],
    "headers": ["ip", "dns"],
    "out": [["", ""]]
  • If response status is 200 (OK), response is a JSON array (Content-Type: application/json).
  • Each element in the array:
    • Is a result of a query
    • Has an "in" field which is an array of the input params (a request body line).
    • Has an "headers" field which is an array of headers of the SQL query result.
    • Has an "out" field which is an array of arrays of results. Each inner array is a result row.
  • Element #1 is the result of query #1, Element #2 is the result of query #2, and so forth.
  • Static query (without any query params):
    • The response JSON has only one element.

Static query

SQLiteQueryServer --db ./test_db/ip_dns.db --query "SELECT * FROM ip_dns" --port 8080
curl "http://localhost:8080/query"
    "in": [],
    "headers": ["ip", "dns"],
    "out": [
      ["", ""],
      ["", ""],
      ["", ""],
      ["", ""]