-
Notifications
You must be signed in to change notification settings - Fork 680
SQLite
Andrey Gershun edited this page May 25, 2015
·
6 revisions
Now Alasql can work with SQLite's SQL.js JavScript library together. You need to include sql.jl into the project, and attach it to Alasql like in the example below:
<script src="alasql.js"></script>
<script src="sql.js"></script>
<script>
alasql('ATTACH SQLITE DATABASE Chinook("Chinook_Sqlite.sqlite");\
USE Chinook; \
SELECT * FROM Genre',[],function(res){
console.log("Genres:",res.pop());
});
</script>
You can use this feature for advanced ETL operations. For example, you can easily open SQLite file and store it to IndexedDB database:
alasql('ATTACH SQLITE DATABASE geo("geo.sqlite") AS geo1; \
ATTACH INDEXEDDB DATABASE geo AS geo2; \
SELECT * INTO geo2.cities FROM geo1.cities",[]);
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo