GithubHelp home page GithubHelp logo

walkable-server / walkable Goto Github PK

View Code? Open in Web Editor NEW
443.0 443.0 14.0 1.06 MB

A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind

Home Page: https://walkable.gitlab.io/

License: Eclipse Public License 2.0

Clojure 99.35% Shell 0.65%
clojure clojurescript data-driven datomic declarative dynamic edn filter flexible graphql join mysql oracle-database orm postgresql query server sql sqlite sqlite3

walkable's Issues

Add cljs tests

The SQL builder is written in plain Clojure data structure hence it should work in both Clojure and Clojurescript

schema syntax for vector idents is problematic

  • it assumes a primary keyword, which maybe not the case in the future
  • does not allow combination of conditions (AND, OR...)
  • it has different order from that of conditions, so developers may mistake the two

Pre-Condtion in `sqb/compile-schema` suggests only `columns` and `idents` is needed, but fails later for several other keys

See

{:pre [(s/valid? (s/keys :req-un [::columns ::idents]

Due to the use of flatten-multi-keys later, also the following keys are basically mandatory for a schema:

  • joins
  • cardinality
  • extra-conditions

While the first two most likely always exist anyways in any non-trivial example, extra-conditions might actually not be needed and the assert thrown later in flatten-multi-keys is way more confusing than just making them req-un for now?

sub queries

Pull extra data to an entity's keyword with custom sql queries

Quote table and column names

Some database eg sqlite won't work with table or column whose name is a reserved keyword. Generated SQL strings should contains:

`table`.`column`

instead of table.column

Other database supports

I'm trying to test walkable on a fulcro setup with postgres database and it's generating a query syntax that is not supported by postgres. I dig thru the code and it looks likethe generation select queries with back tick. Or possible that I'm missing something here. Can you help? Thanks

add condition syntax: `:_`

when it's not clear which column should be the subject and others are objects of an operator
eg: for this SQL

(?, ?) OVERLAPS (?, ?)
`table_1`.`start_column`, `table_1`.`end_column`, `table_2`.`start_column`, `table_2`.`end_column`

you can use the syntax

{:_ [:overlaps :table-1/start-column :table-1/end-column :table-2/start-column :table-2/end-column]}

Allow keyword aliases

Both full keyword aliases like :table/name:other-table/other-name as well as table aliases like :table/*:other-table/*.
Should be implemented as a pathom plugin.

Allow filter with join

currently only current entity's columns are allowed in filters
There should be :join-filters and :extra-join-filters to provide constraints about join's properties.

{[(:person/all {:filters      {:person/number [:> 0]}
                :join-filters {:person/pets {:pet/yob [:> 1999]}}})]
 [:person/name :person/yob]}
SELECT `person`.`name` AS `person/name`, `person`.`yob` AS `person/yob`
FROM `person`
WHERE
(`person`.`number` IN (SELECT `person_pet`.`person_number`
                      FROM `person_pet` JOIN `pet` ON `person_pet`.`pet_index` = `pet`.`index`
                      WHERE `pet`.`yob` > 1999))
AND
(`person`.`number` > 0)

should make use of #22

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.