Coder Social home page Coder Social logo

danthegoodman1 / sqlgateway Goto Github PK

View Code? Open in Web Editor NEW
52.0 4.0 3.0 204 KB

HTTP Gateway for SQL databases with connection pooling and caching. An Edge Functions's best friend.

Go 99.17% Dockerfile 0.83%
cockroachdb golang http postgres redis transaction wasm

sqlgateway's People

Contributors

danthegoodman1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sqlgateway's Issues

Auth

Need to be able to auth users accessing the nodes.

Probably best to do a Basic Auth in the form of a DSN like http(s)://USER:[email protected] like DBs do. That way a config can just be a single DSN rather than multiple parameters for things like future client libraries.

Backend-less Security Features?

Similar to Firestore security rules, Supabase RLS rules, etc.

We could be given a JWT signing key, and a then write rules based on some JSON property of the decoded token, that allows operations like looking up tables with a (for example) WHERE user_id = {JWT.user_id}.

This is a bit out of scope but an interesting feature to add for allowing frontends to directly access this.

Automated Testing

Extensive automated testing for single and multi-node environments that is run on any request to merge to main, but can also be run locally.

Caching options

Queries should have caching options for how long an individual statement will be cached for. Should explicitly enable caching, and only allow for SELECT statements.

If the cache TTL changes, then we should invalidate and revalidate. 0 always busts cache and deletes it.

Use mailgun's groupcache and use Redis for service discovery to coordinate nodes so the cache size is the collective cluster? Or just use Redis as the cache?

Also set a max response size of the cache so we don't store massive responses.

stale-while-revalidate is a good addition that might be scoped to a separate issue.

Redis Support

Under the /redis prefix. Would need to introduce Redis connection pooling and general handling. Pipelining and MULTI/EXEC would probably come in a second pass.

Vote with ๐Ÿ‘ if you want to see this feature so interest can be measured!

MySQL Support

Under the /mysql prefix. Would require abstraction of transaction handling.

Vote with ๐Ÿ‘ if you want to see this feature so interest can be measured!

JS Client Library

Will be it's own repo, but tracking initial work here.

Should resemble node-postgres in terms of connect with a client, then call query with parameter injections.

Have a multi method that allows you to send the array of queries for atomic execution.

Should have identical query interface for normal and transaction queries.

Configurable timeouts

Right now pretty much everything is set to 30 seconds. They should be configurable via env vars.

For transactions, maybe we allow it to be specific at BEGIN time.

Docs on Running

Cover different ENV vars, behavior when single node vs. clustered, etc.

Also API docs.

Maybe even include some example kubernetes manifests.

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.