sql-js / sql-js/sql.js

A way to attach multiple databases?

Open
#88 26 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I can't figure out how to attach multiple databases to run queries across two sqlite files. Something like this:

ATTACH 'db1.sqlite3' AS db1;
ATTACH 'db2.sqlite3' AS db2;
SELECT * FROM db1.users NATURAL JOIN db2.meta

Works in sqlite at command line. Not sure how to achieve same effect here. Possible?

-Rob

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue; first inspect sql.js's database and query entry points and how SQLite files are loaded. Confirm whether multiple ATTACH statements can be supported, with completion demonstrated by querying across the two SQLite files.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sqlite
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.