All Projects → assafmo → SQLiteQueryServer

assafmo / SQLiteQueryServer

Licence: MIT license
Bulk query SQLite database over the network

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SQLiteQueryServer

Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+1764.58%)
Mutual labels:  http-server, sqlite3
Lithium
Easy to use C++17 HTTP Server with no compromise on performances. https://matt-42.github.io/lithium
Stars: ✭ 523 (+989.58%)
Mutual labels:  http-server, sqlite3
bulk-mail-cli
Do quick, hassle-free email marketing with this small but very powerful tool! 🔥
Stars: ✭ 88 (+83.33%)
Mutual labels:  bulk-operation, bulk-api
Vscode Sqltools
Database management for VSCode
Stars: ✭ 741 (+1443.75%)
Mutual labels:  sql-query, sqlite3
Athena
Test your Security Skills, and Clean Code Development as a Pythonist, Hacker & Warrior 🥷🏻
Stars: ✭ 43 (-10.42%)
Mutual labels:  sqlite3
yams
YAMS: Awesome MIPS Server
Stars: ✭ 17 (-64.58%)
Mutual labels:  http-server
Queries
SQLite queries
Stars: ✭ 57 (+18.75%)
Mutual labels:  sqlite3
sheret
A tiny, simple static file web server.
Stars: ✭ 45 (-6.25%)
Mutual labels:  http-server
bun
SQL-first Golang ORM
Stars: ✭ 1,570 (+3170.83%)
Mutual labels:  sqlite3
snunit
Scala Native HTTP server based on NGINX Unit
Stars: ✭ 87 (+81.25%)
Mutual labels:  http-server
SqlFun
Idiomatic data access for F#
Stars: ✭ 33 (-31.25%)
Mutual labels:  sql-query
aqua
A minimal and fast 🏃 web framework for Deno
Stars: ✭ 219 (+356.25%)
Mutual labels:  http-server
python-simple-http-server
A super light way HTTP server written by python, support websocket and coroutine.
Stars: ✭ 26 (-45.83%)
Mutual labels:  http-server
smartacus-mqtt-broker
smartacus-mqtt-broker is a Java-based open source MQTT broker that fully supports MQTT 3.x .Using Netty 4.1.37
Stars: ✭ 25 (-47.92%)
Mutual labels:  http-server
PT-Tracking
Aplicação para registo e acompanhamento de encomendas da CTT Expresso, automatiza a consulta online do estado de tracking para várias remessas e mantém um registo dos pagamentos referentes aos envios à cobrança. As remessas que requerem atenção, devido a atrasos na entrega ou na receção do pagamento correspondente, bem como os cheques cuja data …
Stars: ✭ 18 (-62.5%)
Mutual labels:  sqlite3
b23.wtf
Remove tracing parameters from b23.tv/*.
Stars: ✭ 85 (+77.08%)
Mutual labels:  http-server
minimal-http-server
Basic http server
Stars: ✭ 26 (-45.83%)
Mutual labels:  http-server
food-sqlite-demo
This tutorial we will save text from EditText and Image from gallery into SQLite database
Stars: ✭ 58 (+20.83%)
Mutual labels:  sqlite3
Thinktecture.EntityFrameworkCore
These libraries extend Entity Framework Core by a few features to make it easier to work with EF and for easier integration testing or to get more performance in some special cases.
Stars: ✭ 26 (-45.83%)
Mutual labels:  bulk-operation
go-import-server
HTTP server for canonical "go get" import path
Stars: ✭ 29 (-39.58%)
Mutual labels:  http-server

SQLiteQueryServer

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

CircleCI Coverage Status Go Report Card

Installation

  • Download a precompiled binary from https://github.com/assafmo/SQLiteQueryServer/releases

  • Or use go get:

    go get -u github.com/assafmo/SQLiteQueryServer

    This package uses github.com/mattn/go-sqlite3. Compilation errors might be resolved by reading https://github.com/mattn/go-sqlite3#compilation.

  • Or use Ubuntu PPA:

    curl -SsL https://assafmo.github.io/ppa/ubuntu/KEY.gpg | sudo apt-key add -
    sudo curl -SsL -o /etc/apt/sources.list.d/assafmo.list https://assafmo.github.io/ppa/ubuntu/assafmo.list
    sudo apt update
    sudo apt install sqlitequeryserver

Usage

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.

Examples

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 "github.com\none.one.one.one\ngoogle-public-dns-a.google.com" | 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 "github.com\none.one.one.one\ngoogle-public-dns-a.google.com" | curl "http://localhost:8080/query" --data-binary @-
[
  {
    "in": ["github.com"],
    "headers": ["ip", "dns"],
    "out": [["192.30.253.112", "github.com"], ["192.30.253.113", "github.com"]]
  },
  {
    "in": ["one.one.one.one"],
    "headers": ["ip", "dns"],
    "out": [["1.1.1.1", "one.one.one.one"]]
  },
  {
    "in": ["google-public-dns-a.google.com"],
    "headers": ["ip", "dns"],
    "out": [["8.8.8.8", "google-public-dns-a.google.com"]]
  }
]
  • 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": [
      ["1.1.1.1", "one.one.one.one"],
      ["8.8.8.8", "google-public-dns-a.google.com"],
      ["192.30.253.112", "github.com"],
      ["192.30.253.113", "github.com"]
    ]
  }
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].