royallthefourth / bartlett Goto Github PK
View Code? Open in Web Editor NEWGenerate a web API automatically from your database
License: Other
Generate a web API automatically from your database
License: Other
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)Allow mounting routes with a prefix like /api
instead of putting everything at /
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
Establish a graph of foreign keys and allow JOIN
queries against them. Consider taking the "record embedding" approach from Postgrest.
Add CI tests instead of relying on local testing. Other projects have already figured out this sort of testing.
In the MariaDB driver, fields in the TEXT
family are being inserted with blank values.
Generate UPDATE
queries. Reject any requests sent without a WHERE
.
Datetime fields can't be decoded to time.Time
. Scan them into string
instead.
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?
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.
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.
Generate LIMIT n
and LIMIT m, n
queries
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.
Test querying views to be sure that the column selection approach for each driver is not solely applicable to real tables
Headers should have Content-Type: application/json
Error messages are currently sent to the log, but they should really go out to the client as well.
Allow users to specify the columns returned as in postgrest
Generate INSERT
queries
route.go
Generate queries like ORDER BY col1 ASC, col2 DESC...
Consider mimicking the Postgrest behavior
Routes()
should return []Route
instead of []function, []string
Implment and
and or
query params to generate nested conditions
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.
Generate DELETE
queries. Reject any queries sent without a WHERE
.
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.
Allow users to select the output name used for their specified columns
Using reflection on each read seems like a waste when the proper type is already stored in the driver
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.
Link a demo application in the readme
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.