-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the series extension #552
Comments
I'm also interested if you just explain to me how to add the |
This project has been mostly dormant for a few years, probably in part because there is now a SQLite browser API under the official SQLite umbrella. That might be a more forward-looking path for you. I have no idea how easy or difficult it is to add extensions, but the developer is pretty responsive on the SQLite forum. |
My guess is your problem is here. For some reason you're not compiling your extension with the same compilation flags used everywhere else. |
You are correct, this is my exact problem. I was not using I am also going to have a look at umbrella. We have already built almost all our project with SQL.js so we can not really redo everything at the moment but this is definitely something I will have a look at! |
Sorry @rhashimoto, the build works well on Node.js, but as soon as it's opened on a web browser, I'm getting this error:
HTML Code to reproduce the issue in 30 seconds: <meta charset="utf8" />
<html>
<script src='https://sql.js.org/dist/sql-wasm.js'></script>
<script>
config = {
locateFile: filename => `https://raw.githubusercontent.com/dumpus-app/sql.js/master/dist/${filename}`
}
// The `initSqlJs` function is globally provided by all of the main dist files if loaded in the browser.
// We must specify this locateFile function if we are loading a wasm file from anywhere other than the current html page's folder.
initSqlJs(config).then(function(SQL){
//Create the database
const db = new SQL.Database();
// Run a query without reading the results
db.run("CREATE TABLE test (col1, col2);");
// Insert two rows: (1,111) and (2,222)
db.run("INSERT INTO test VALUES (?,?), (?,?)", [1,111,2,222]);
// Prepare a statement
const stmt = db.prepare("SELECT * FROM test WHERE col1 BETWEEN $start AND $end");
stmt.getAsObject({$start:1, $end:1}); // {col1:1, col2:111}
// Bind new values
stmt.bind({$start:1, $end:2});
while(stmt.step()) { //
const row = stmt.getAsObject();
console.log('Here is a row: ' + JSON.stringify(row));
}
});
</script>
<body>
Output is in Javascript console
</body>
</html> All our code is still on our repo https://github.com/dumpus-app/sql.js/tree/master thank you so much 🙏 |
Do you have a idea? |
Hello 👋
I'm trying to add the
generate_series
function from the series extension to the SQLite build.At the moment, here is what I have done so far:
series.c
file and add it to thewasm
output._sqlite3_series_init
function to thesrc/exported_functions.json
filesrc/api.js
file so it calls thesqlite3_series_init
functionI read #459 and it seems like we had to do this...?
when running the tests, I'm getting the following error:
Here is my fork with all the modifications I have made: https://github.com/Androz2091/sql.js
Can someone help me to understand? Maybe @twoxfh, and @rhashimoto, who solved the issue #459?
The text was updated successfully, but these errors were encountered: