Git Product home page Git Product logo

bartlett's People

Contributors

royallthefourth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kr4ster

bartlett's Issues

Add timeout support

A query shouldn't take very long to turn around. Add a time.Duration and a mechanism for cancelling slow requests. Perhaps a context deadline is appropriate here?

Add UserID handling

When a table specifies a UserID column, require that user provider can produce an ID from the request info and append a clause specifying the ID to the query

  • SQLite3
  • MariaDB

Add option for ID generating function

Tables should allow the programmer to specify the ID column and a function that generates new ID values for inserts. This will pave the way for inserting to tables with non-increment keys and returning last insert ID.

Add table probing

Bartlett such have a ProbeTables method that automatically populates the table list. Driver interface should also provide the same method that returns a slice of table names for consumption by Bartlett.

Should not overwrite tables that have already been provided.

Add UPDATE

Generate UPDATE queries. Reject any requests sent without a WHERE.

Perform injection mutation testing

Part of providing a safe library is empirically validating the ability to handle garbage input. Throw a bunch of injection attempts at an actual website with sqlmap or similar tools.

Add prefix option

Allow mounting routes with a prefix like /api instead of putting everything at /

Add DELETE

Generate DELETE queries. Reject any queries sent without a WHERE.

Add CI testing

Add CI tests instead of relying on local testing. Other projects have already figured out this sort of testing.

Allow single-valued insert

On inserts, check the incoming payload. If it's not an array, do a single insert and return the ID instead of the row count.

Report error messages

Error messages are currently sent to the log, but they should really go out to the client as well.

Add LIMIT

Generate LIMIT n and LIMIT m, n queries

Add INSERT

Generate INSERT queries

  • Test post handler in route.go
  • Test IDColumn
  • Test UserID

Add filter criteria

Allow requests to specify a single level of WHERE...AND conditions. Each condition should support a not. prefix for negation.

  • eq
  • neq
  • gt
  • gte
  • lt
  • lte
  • like
  • is
  • in (including quoted strings)

Add ORDER BY

Generate queries like ORDER BY col1 ASC, col2 DESC...

Verify view query support

Test querying views to be sure that the column selection approach for each driver is not solely applicable to real tables

Fix insert reporting

Currently, a SQL error will cause a malformed result body with two JSON objects side by side, one for the error and another for the quantity of inserts.
Instead, collect all insert errors into an errors output array to go into the result object.

Add a caching driver

Implement a caching driver that wraps a normal database driver. Create a cache interface and implement cache backends. An in-memory backend will be the simplest. Lessons learned there will allow broadening the scope to supporting systems like Redis.

Add a JOIN capability

Establish a graph of foreign keys and allow JOIN queries against them. Consider taking the "record embedding" approach from Postgrest.

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.