AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.04k stars 659 forks source link

localstorage: creating view succeeds but selecting from it fails #1470

Open chapmanjacobd opened 2 years ago

chapmanjacobd commented 2 years ago
alasql.version
"1.7.3-develop-0be167bcundefined" 

alasql(`select entries.*
        , watched.id IS NOT NULL as watched
      from entries
      outer join watched on watched.id = entries.id and watched.ie_key = entries.ie_key
      where entries.id not in (select distinct id from watched) `) 
Array(436) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ]

// but

alasql(`create view test as select entries.*
        , watched.id IS NOT NULL as watched
      from entries
      outer join watched on watched.id = entries.id and watched.ie_key = entries.ie_key
      where entries.id not in (select distinct id from watched) `)
1
alasql('select * from test')
Uncaught TypeError: this.queriesfn is undefined
    anonymous alasql.js:3
    n3 alasql.min.js:2
    n3 alasql.min.js:2
    n3 alasql.min.js:2
    $ alasql.min.js:2
    L alasql.min.js:2
    fromTable alasql.min.js:2
    datafn alasql.min.js:2
    r2 alasql.min.js:2
    r2 alasql.min.js:2
    r2 alasql.min.js:2
    datafn alasql.min.js:2
    r2 alasql.min.js:2
    r2 alasql.min.js:2
    r2 alasql.min.js:2
    dexec alasql.min.js:2
    exec alasql.min.js:2
    bi alasql.min.js:2

You can load the demo data here and run the same query directly: https://unli.xyz/eject/

Julias0 commented 1 year ago

Can you assign this to me