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.01k stars 653 forks source link

alasql not checking schema on insertion #926

Open laturner42 opened 7 years ago

laturner42 commented 7 years ago

We are trying to use alasql to create some tables and insert data. However, there doesn't seem to be any schema validation going on.

Here is the code we are running:

alasql('CREATE TABLE BUG_TABLE(fieldA INTEGER);')
alasql('INSERT INTO BUG_TABLE ("how");')
console.log(alasql('SELECT * FROM BUG_TABLE;'));

And the output:

[ { fieldA: 'how' } ]

I'm not sure how "how" can be inserted into the table if the datatype is 'INTEGER'. Is this a bug or is there a piece of documentation I am missing? We are using alasql 0.4.1

mathiasrw commented 7 years ago

Its a bug...

laturner42 commented 7 years ago

Okay, good to know. Pretty big bug IMO. Any time frame on new releases?

mathiasrw commented 7 years ago

Any pull request addressing this issue will be welcomed with open arms.

Nayan-Das commented 5 years ago

Can I work on this. Would it be possible to guide me ?

mathiasrw commented 5 years ago

@Nayan-Das Sure!

How many of the steps in https://github.com/agershun/alasql/blob/develop/.github/CONTRIBUTING.md have you been able to follow?

mathiasrw commented 5 years ago

@Nayan-Das Still keen to help out?