![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@linked-db/linked-ql
Advanced tools
A query client that extends standard SQL with new syntax sugars and enables auto-versioning capabilities on any database
The object-oriented, adaptive SQL client for modern apps - query anything from the plain JSON object, to the client-side IndexedDB, to the server-side DB.
Linked QL is a query client that wraps powerful concepts in a simple, succint API.
Take a one-minute overview of Objective SQL.
Obtain an Objective SQL query client for your target database:
For SQL databases, import and instantiate the SQL language driver. (You'll pass in the name of an appropriate database connection driver that works for your database.)
// Import SQL
import { SQL } from '@webqit/objective-sql';
// Using the 'mysql2' connector (npm install mysql2)
const connectionDriver = 'mysql2';
const connectionParams = {
host: '127.0.0.1',
user: 'root',
password: '',
};
// Create an instance by calling .connect().
const client = SQL.connect(connectionDriver, connectionParams);
// Or by using the 'new' keyword.
const client = new SQL(connectionDriver, connectionParams);
For the client-side IndexedDB database, import and instantiate the IDB language driver.
IndexedDB is a low-level API for client-side storage.
// Import IDB
import { IDB } from '@webqit/objective-sql';
// Create an instance.
const client = new IDB;
To work with Objective SQL's in-memory object storage, import and instantiate the ODB language driver.
This is an environment-agnostic in-memory store.
// Import IDB
import { ODB } from '@webqit/objective-sql';
// Create an instance.
const client = new ODB;
All client
instances above implement the same interface:
The client.query()
method lets you run any SQL query on your database.
// Run a query
client.query('SELECT fname, lname FROM users').then(result => {
console.log(result);
});
Other methods give us a programmatic way to manipulate or query the database. (Docs coming soon.)
client.createDatabase()
and client.createDatabaseIfNotExists()
methods. (Returning a Database
instance (database
).)client.dropDatabase()
and client.dropDatabaseIfExists()
methods.client.databases()
method - for listing databases, and the client.database(name)
method - for obtaining a Database
instance (database
).database.createTable()
, database.alterTable()
, and database.dropTable()
methods.database.tables()
method - for listing tables, the database.table(name)
method - for obtaining a Table
instance (table
).table.getAll()
method - for listing entries, the table.get(id)
method - for obtaining an entry, the table.count()
method - for count.table.addAll()
and table.add()
methods.table.putAll()
and table.put()
methods.table.deleteAll()
and table.delete()
methods.Learn more about the API. (DOCS coming soon.)
Objective SQL is a superset of the same familiar, powerful SQL language you know...
SELECT post_title, users.fname AS author_name FROM posts
LEFT JOIN users ON users.id = posts.author_id;
...with an object-oriented syntax for relationships, built into the language...
SELECT post_title, author_id->fname AS author_name FROM posts;
...and that's SQL without the query complexity!
Learn more about the language and see just what's possible with the arrow syntax. (DOCS coming soon.)
To report bugs or request features, please submit an issue to this repository.
MIT.
FAQs
A query client that extends standard SQL with new syntax sugars and enables auto-versioning capabilities on any database
We found that @linked-db/linked-ql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.