Giter Site home page Giter Site logo

sqlite-server's Introduction

Sqlite Server

Sqlite is capable of handling more load than you'd think. This application creates a server which is connected to with tcp connections, just like all client/server databases. Each connection to the server creates one connection to the database. This is a lightweight alternative to a full-blown client/server database, such as MySQL or Postgres. Configuration is very simple, and all data is stored in a single sqlite db file. The sqlite file can still be accessed the way you normally would, and the server can be put in front of an existing database.

I'm just getting started on this project. More features to come.

Configuration

Copy sqlite-server.cnf.tpl to ~/.sqlite-server.cnf and update values as needed.

Response Format

When the server receives a query, it immediately queues it for processing and returns an acknowledgement back to the requestor which contains a unique id representing the query. This id will be sent with each result record for identifications:

SOH	01	start of header
    DC1 11 device control 1
        <request id>
    DC1 11 device control 1
    ACK	06	negative acknowledgement
EOT	04	end of transmission

If server is actively draining the connection, it will return a negative acknowledgement for any requests until the connection is closed:

SOH	01	start of header
    NAK	21	negative acknowledgement
EOT	04	end of transmission

Server responses are sent in a delimited format as outlined below. Note that inserts and updates will return a row containing last inserted id and number of records changed.

SOH	01	start of header
    DC1 11 device control 1
        <request id>
    DC1 11 device control 1
    SOH	01	start of header
        <header row>
        <record row 1>
        <record row 2>
        <record row n>
EOT	04	end of transmission

Column delimiter (3 bytes):

NUL	00	null character
RS	30	record separator
NUL	00	null character

Row delimiter (3 bytes):

NUL	00	null character
US	31	unit separator
NUL	00	null character

If an error is returned from the server, it will be text wrapped in the following characters:

SOH	01	start of header
    DC1 11 device control 1
        <request id>
    DC1 11 device control 1
    BEL	7	bell
        <error text>
EOT	04	end of transmission

Queries which do not return a result simply return an acknowledgement upon completion:

SOH	01	start of header
    DC1 11 device control 1
        <request id>
    DC1 11 device control 1
    EOT	04	end of transmission
EOT	04	end of transmission

sqlite-server's People

Contributors

turntayble81 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.