Code Monkey home page Code Monkey logo

jsoql's People

Contributors

ta-stott-oe avatar tastott avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gitter-badger

jsoql's Issues

Support all datasources in SELECT sub-query

Currently, datasources which are enumerated asynchronously (anything except var?) cannot be used in a SELECT sub-query such as:

SELECT
   (SELECT COUNT() FROM 'file://blah') AS CountOfBlah
FROM
   ...

GUI themes

Maybe just light and dark? Will need to set css and ACE theme

Nested property of object root in FROM

Where the source contains a single top-level object (e.g. a .json file with an object as its root, a .jsons file with a single entry), allow an array property of this object to be used as the dataset.
E.g.

SELECT * FROM 'file://MyObject.json'.Things

(Query on Things)

Read from CSV

Map each row to an object using headings from the file or some headings specified in the query?

Drag'n'drop files onto query editor

Drop a .jsoql file onto the editor to open the query therein in a new tab. Drop any other file onto the editor to (attempt to) use it as the FROM target with a SELECT * query.

Expressions in SELECT list

E.g.

SELECT SomeNumberProperty + AnotherNumberProperty AS SumOfStuff FROM 'file://things.json'

or

SELECT Name + ' has ' + HairColour + ' hair' FROM 'file://people.json'

Fix HTTP datasource

Lazy.makeHttpRequest() apparently breaks the response up into chunks. The only reason my unit test passed was that the test data was smaller than the chunk size. For a JSON response, these chunks will have to be piped into some kind of rolling JSON parser (oboe?) that can spit out parsed objects. The browser version perhaps doesn't split into chunks (or uses bigger chunks?) so I haven't come across this issue there yet.

Store dropped files in local storage in online GUI

Dropping a file in the desktop GUI just means that the file path can be used as a datasource. In the online GUI, the file should be copied to local storage and the file scheme should read from there. Auto-complete for file:// in the online GUI should list previously copied files.

Better syntax for datasource parameters

Currently there are various datasource parameters in use:

  • format
  • path (perhaps better named root)
  • headers
  • skip

These are set in a kind of pseudo query string thing but that means, for an HTTP datasource, they get mixed up with any true query string parameters. Instead, there should be some syntax for setting these parameters alongside the URI.
E.g.

FROM
    { "uri": "http://mydata.com/some.json", "root": "blah"}

Content-less folder query

Maybe it would be useful to be able to query the files in a folder without inspecting their content?
E.g.

SELECT @@File FROM 'file://my/folder?format=ignore' ORDER BY @@File.modifiedDate DESC

Read from url

E.g. SELECT Thing FROM http://my-api/some-json. Maybe with option to set some HTTP headers.

Operations on nulls

Check whether or not a property value is null:

SELECT Blah FROM Thing WHERE Blah IS NOT NULL

Use a replacement value if a property value is null: ISNULL(Blah, 'Default') (TSQL-like) or SELECT Blah || 'Default' (Javascript-like) or SELECT Blah ?? 'Default' (C#-like).

Allow relative URLs in browser mode

This can use the normal HTTP datasource because there is no CORS issue. There should be some character in the url to indicate that the path is relative to the current domain. I'm leaning towards tilde (~) as it's used that way in ASP.NET and it's a bit easier to spot than adding another /.
E.g. http://~/Data/blah.json

Folder as data source

E.g. SELECT * FROM 'file://somefolder' where somefolder contains one or more .json files. Each file is treated as one item in the dataset. The filename for each item is available via some special property (e.g. @Filename).

To filter the files or work with file extensions other than .json, there could be a parameter which accepts something like a glob pattern. There could also be an option to enable/disable recursive folder searching.

Syntax highlighting

Use Jison parse info to locate keywords, property names, functions, etc. and colour them in the console (or whatever UI there is)

Read from true JSON file

Currently the source file has to consist of JSON objects separated by newlines. A true JSON file containing a JSON array should be supported too.

"Deep" SELECT

Allow JSON-like structures in SELECT clause so that the output can take any form.
E.g.

SELECT
    Input1,
    {
        Something: Input2
    } AS Deep
FROM
    ...

String functions

Support some operations on strings such as substrings and regular expressions.

OVER

Basically copy the OVER keyword from n1ql which can be used to enumerate the children of each item. E.g.

SELECT
   author.Name,
   book.Name,
   book.ISBN
FROM
   'file://authors.json' as author
    OVER author.Books AS book

Embed example queries in URL for online GUI

For demo/wiki purposes, it would be very useful to have the online GUI pre-populate the query editor with a JSOQL query from the query string.
E.g.

http://tastott.github.io/jsoql?query=SELECT%20*%20FROM%20%27file%3A%2F%2Fblah%27

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.