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
6.98k stars 649 forks source link

Error while using alaSQL #1843

Closed Vislesha closed 7 months ago

Vislesha commented 7 months ago

Hi Team:

Getting the following error while using alaSQL on a JSON object:

TypeError: (alasqlWEBPACK_IMPORTED_MODULE0namespace_cache || alasqlWEBPACK_IMPORTED_MODULE0namespace_cache) is not a function

let allYearsQry = "SELECT DISTINCT YEAR(transactionDate) FROM ? ORDER BY 1 DESC"; let allYears = alasql(allYearsQry , [transactionData]);

Using the library on: Angular: 16.2.12 alaSQL: 4.2.2

No other errors are noticed during compilation.

mathiasrw commented 7 months ago

How did you import it?

Vislesha commented 7 months ago

Thanks for the quick reply! I tried following ways to import alaSQL.

import * as alasql from 'alasql'

import * as alasql from 'script!alasql

import alasql from 'alasql'

No luck with any of the above!

mathiasrw commented 7 months ago

Have you tried to require the lib?

Vislesha commented 7 months ago

Tried this as well with no luck!

let alasql = require('alasql');

Vislesha commented 7 months ago

Not sure what you mean by "require" the lib! Could you be little specific please?

mathiasrw commented 7 months ago

Try stack overflow.

Vislesha commented 7 months ago

Thanks!