tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
289 stars 37 forks source link

Feature Question: in memory in browser. #141

Closed PorcoRosso85 closed 9 months ago

PorcoRosso85 commented 11 months ago

Hi. I appreciate that libSQL is now faithfully reproducing sqlite's API. https://www.sqlite.org/inmemorydb.html

Requirement is to query to in memory database on browser using sql.

I am aware that the in-memory function asks for a url, and that url points to a local or remote physical database. From reading the documentation, I do not believe that there is currently a feature to create an in-memory table in the browser, is this understanding correct?

Is there already a roadmap drawn up for this feature to be added in the future?

Thank you.

PorcoRosso85 commented 11 months ago

I will update my perception and also update my question.

In light of the fact that libSQL can perform queries against url locations, I am now aware that libSQL already has the ability to generate a database in memory from query results, regardless of the client platform to query.

Correct? If correct, how to query sql from browser to remote url?

import { createClient } from "@libsql/client/web";
penberg commented 10 months ago

@PorcoRosso85 I just merged @libsql/client-wasm package, which may allow you to do this. I didn't test it with a browser yet, though.

PorcoRosso85 commented 10 months ago

Thanks for your info. I'll try.

penberg commented 9 months ago

@PorcoRosso85 I have tested this in the browser and works fine.