-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The API from sqlectron
was pretty unorganized. Because falcon-core
was a fork of it, we had to borrow its architecture. I think core has matured enough to the point where we can migrate away from sqlectron's
API and move towards one of our own: one that's more object oriented and namespaced to allow for faster imports, which we need. To keep a lot of the lower level database specific logic out of the UI, this newer API for falcon-core
should be higher level.
import { ConnectionPool, ConnectionManager } from 'falcon-core';
import { SqliteProvider } from 'falcon-core/sqlite';
const connetionManager = new ConnetionManager();
const pool = new ConnectionPool();
const provider = new SqliteProvider();
const dbConn = await provider.connect({
database: 'demo.sqlite',
readonly: true
});
connectionManager.add(dbConn.config);
pool.add(dbConn);
// Connect to a favorite connection
const [firstConnection] = await connectionManager.getAll();
firstConnection.connect();
Metadata
Metadata
Assignees
Labels
No labels