Skip to content
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

Integrate mvsqlite as a distributed database on foundationdb and libsqlite #116

Open
fire opened this issue Jan 25, 2023 · 7 comments
Open

Comments

@fire
Copy link

fire commented Jan 25, 2023

Since libsql is a sqlite derivative, I am trying to explore ways of embedding @losfair's amazing work with libsql.

https://github.com/losfair/mvsqlite

@fire fire changed the title Use mvsqlite distributor as a distributed databased on foundationdb Integrate mvsqlite as a distributed databased on foundationdb and libsqlite Jan 25, 2023
@fire fire changed the title Integrate mvsqlite as a distributed databased on foundationdb and libsqlite Integrate mvsqlite as a distributed database on foundationdb and libsqlite Jan 25, 2023
@psarna
Copy link
Collaborator

psarna commented Jan 25, 2023

Oh we are exploring that as well! https://github.com/libsql/sqld/blob/main/sqld/src/libsql/mwal/mod.rs , right now it works on top of a fork of mvSQLite which implements a frontend with virtual WAL instead of VFS: https://github.com/psarna/mvsqlite/tree/mwal

@psarna
Copy link
Collaborator

psarna commented Jan 25, 2023

And we're interested in the other way round, i.e. making libSQL better suited to run mvSQLite as well, e.g. #11, #12, #20

@fire
Copy link
Author

fire commented Jan 26, 2023

Did you document the steps needed to convert libsql to mvsqlite?

@fire
Copy link
Author

fire commented Jan 26, 2023

Also I am investigating how to have a limit of 15 seconds or less configuration option for timeouts in wasmtime

@psarna
Copy link
Collaborator

psarna commented Jan 26, 2023

Did you document the steps needed to convert libsql to mvsqlite?

What do you mean by convert? One of the ways mvSQLite is used is to just LD_PRELOAD an application that uses SQLite with a mvSQLite library - you can do exactly the same with an application that uses libSQL, and it will work (https://su3.io/posts/mvsqlite#drop-in-addition), because libSQL is compatible with SQLite ABI.

@fire
Copy link
Author

fire commented Jan 26, 2023

My goal is to make a static library and merge it with my variation of the Godot Engine.

Problems

  1. static library linking is broken in the official release of libsql for wasm
  2. libsql as sqlite3.h / sqlite3.cpp for mvsqlite requires changes to rename "sqlite3_step" to "real_sqlite3_step" and "sqlite3_open_v2" to "real_sqlite3_open_v2"

@psarna
Copy link
Collaborator

psarna commented Jan 26, 2023

static library linking is broken in the official release of libsql for wasm
@fire can you post the steps to reproduce your issue with static linking? It works for libsql/sqlite3 shell just fine on my x86-64, maybe it's an arch issue?

It's also worth noting that Wasm UDF support, being written in Rust, is not part of the single amalgamation sqlite3.c file, and is instead produced as a static library, libwblibsql.a, which you can find precompiled in .libs directory of libsql-0.1.0-wasm-udf.tar.gz file from our official release.

Alternatively, if you compile from source, the static library can also be found in ./libwblibsql.a.

And if you're integrating Wasm support with a Rust application, it's best to skip linking with the static library and instead integrate directly with the Rust crate: https://crates.io/crates/libsql-wasmtime-bindings.

It's now definitely clear to me that the process is not documented, which makes it hard for users to consume, and we should fix that. But please also let me know if any of the paragraphs above helped!

MarinPostma added a commit that referenced this issue Oct 17, 2023
116: fix parse http integers params r=MarinPostma a=MarinPostma

This PR fixes integers parsing in http parameters


Co-authored-by: ad hoc <postma.marin@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants