FireSQL is a JavaScript library (v2.0.2, latest stable) that enables querying Cloud Firestore using SQL syntax. Built on the official Firebase SDK, it translates SQL SELECT statements into Firestore queries, minimizing server requests. Key differentiators: support for SELECT, WHERE, ORDER BY, LIMIT, GROUP BY, aggregate functions (AVG, MIN, MAX, SUM), nested field access with backtick syntax, and realtime updates via RxJS observables (requires rxfire). Limitations include no INSERT/UPDATE/DELETE, no JOINs, limited LIKE, and no COUNT. Releases are infrequent; maintained on GitHub.
npm install firesqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes FireSQL with a Firestore reference and runs a simple SELECT query.
Use ESM imports (import { FireSQL } from 'firesql') and ensure your environment supports ES modules.Use firebase/compat for now, or wait for FireSQL update. Example: import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore';
Add import 'firesql/rx' before using .rxQuery(). Also install rxjs and rxfire.
Avoid using ORDER BY or LIMIT in queries that contain GROUP BY.
Include `__name__` in your SELECT statement, e.g., SELECT __name__, name FROM collection.
Use LIKE 'value%' for prefix search; for other patterns, use alternative filtering.
Create a new FireSQL instance referencing the document or subcollection path manually.
Run 'npm install firesql firebase' and ensure 'type': 'module' in package.json or use .mjs extension.
Change import statement to: import { FireSQL } from 'firesql'Install firebase/compat: import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore';
Install rxjs and rxfire: npm install rxjs rxfire