r-dbi / RSQLite

R interface for SQLite
https://rsqlite.r-dbi.org
GNU Lesser General Public License v2.1
325 stars 78 forks source link

Connect to remote sqlite database #505

Open seanbirchall opened 2 months ago

seanbirchall commented 2 months ago

I've seen other implementations in Python / JS / GO but haven't found anything for R.

Is there anyway to query a remote sqlite database say hosted on some S3 compatible webserver directly? I created the below public mtcars sqlite db.

library(RSQLite)
library(DBI)

con <- dbConnect(RSQLite::SQLite(), "https://scrapeable-share.nyc3.digitaloceanspaces.com/data.db")

GO JS

krlmlr commented 2 months ago

Thanks, I'm not familiar with these ideas. Would you like to share a pointer?

seanbirchall commented 2 months ago

Let me put together some code to try and recreate, but it looks like there is a way to use http range headers to query sqlite files directly on a web server. I'm trying to figure out if this is an effort needed on the client or if I need to compile the sqlite database to some type of standalone wasm file. So something similar to httpfs with duckdb appears to be doable with sqlite too.