🦆
ws4sqlite
v0.16
v0.16
  • 🌱Introduction & Credits
  • 🥇Features
    • 🚄Performances
  • 🏫Tutorial
  • 🔦Cheat Sheet
  • 🏗️Building & Testing
  • 🛡️Security
  • 📖Documentation
    • 🔧Installation
      • 🐳Docker
    • 🏃Running
    • 📃Configuration File
    • 🔓Authentication
    • 📦Stored Statements
    • ❓Requests
    • ❗Responses
    • ❌Errors
    • 🔨Scheduled Tasks
    • 🌐Embedded Web Server
  • 💡Client Libraries
  • 🎓Advanced Topics
  • 🪐Integrations
    • ⚙️Reverse Proxy
  • ⚖️License
  • 👷GitHub Repository
  • 🚁Support on Discord
Powered by GitBook
On this page
Edit on GitHub

Introduction & Credits

Query sqlite via http - and remote clients too!

NextFeatures

Last updated 11 months ago

📢 This project's next version was forked, that will support more databases than sqlite (hence the new name, if you noticed 😉). It will take some time, through improvements and, alas, breaking changes. The development is happening in the branch, and you can find the changes and the steps needed to migrate a regular installation in the document.

I recently started a over the future direction for this project. Take a look, and chip in if you want!

🌱 Introduction & Credits

ws4sqlite is a server-side application that, applied to one or more SQLite files, allows to perform SQL queries and statements on them via REST (or better, JSON over HTTP).

Possible use cases are the ones where remote access to a sqlite db is useful/needed, for example a data layer for a remote application, possibly serverless or even called from a web page (after security considerations of course).

Client libraries are available, that will abstract the "raw" JSON-based communication. See for Java/JVM, for Go(lang); others will follow.

As a quick example, after launching

ws4sqlite --db mydatabase.db

It's possible to make a POST call to http://localhost:12321/mydatabase, e.g. with the following body:

// Set Content-type: application/json
{
    "transaction": [
        {
            "statement": "INSERT INTO TEST_TABLE (ID, VAL, VAL2) VALUES (:id, :val, :val2)",
            "values": { "id": 1, "val": "hello", "val2": null }
        },
        {
            "query": "SELECT * FROM TEST_TABLE"
        }
    ]
}

Obtaining an answer of:

{
    "results": [
        {
            "success": true,
            "rowsUpdated": 1
        },
        {
            "success": true,
            "resultSet": [
                { "ID": 1, "VAL": "hello", "VAL2": null }
            ]
        }
    ]
}

Credits

Many thanks and all the credits to these awesome projects:

(MIT License);

(MIT License);

(MIT License);

(3-Clause BSD license);

(MIT License);

(3-Clause BSD License);

(MIT License)

and of course, .

Kindly supported by

🌱
fork/ws4sql
ROAD_TO_WS4SQL.md
discussion
here
here
lnquy's cron
robfig's cron
gofiber's fiber
klauspost's compress
mitchellh's go-homedir
modernc.org's sqlite
wI2L's jettison
Google Go
JetBrains for Open Source development