Registry / database / datasquirel

datasquirel

JSON →
library2.0.0jsnpmunverified

Datasquirel is a cloud-based SQL data management tool that provides a simple API for executing SQL queries and managing data over HTTPS. Version 2.0.0 supports SELECT, INSERT, UPDATE, DELETE operations via a RESTful interface, with separate read-only and full-access API keys. It requires an account at datasquirel.com and relies solely on server-side authentication. Compared to direct database drivers, Datasquirel abstracts away connection and infrastructure management, but adds latency and rate limits. The library is minimal, wrapping fetch-like calls, and does not support real-time queries or complex joins beyond standard SQL.

npm install datasquirel
INSTALL
IMPORT
SIG · DATASQUIREL
D
datasquirel
databasejavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

datasquirel
const datasquirel = require('datasquirel');
import datasquirel from 'datasquirel';
Package does not ship ESM exports; use CommonJS require(). The default export is an object with get, post, uploadImage methods.
get
const result = await require('datasquirel').get({key: '...', db: '...', query: '...'});
Accessing get directly without the default object may fail. Always use the default import.
post
const datasquirel = require('datasquirel'); const result = await datasquirel.post({key: '...', payload: {...}});
import { post } from 'datasquirel';
Named exports not supported; must use default object.
uploadImage
const datasquirel = require('datasquirel'); await datasquirel.uploadImage({key: '...', payload: {...}});
import { uploadImage } from 'datasquirel';
Only accessible through default import.

Demonstrates read-only SELECT, INSERT, and image upload with both key types using CommonJS require.

const datasquirel = require('datasquirel'); async function main() { // Fetch data with readonly key const result = await datasquirel.get({ key: process.env.DATASQUIREL_READONLY_KEY ?? '', db: 'my_database', query: 'SELECT * FROM blog_posts' }); console.log('Rows:', result); // Insert data with full-access key const insertResult = await datasquirel.post({ key: process.env.DATASQUIREL_FULLACCESS_KEY ?? '', payload: { action: 'insert', table: 'users', data: { user_id: '123', user_name: 'Jane Doe' } } }); console.log('Inserted:', insertResult); // Upload an image const imageResult = await datasquirel.uploadImage({ key: process.env.DATASQUIREL_FULLACCESS_KEY ?? '', payload: { imageData: Buffer.from('placeholder').toString('base64'), imageName: 'sample', mimeType: 'png' } }); console.log('Image uploaded:', imageResult); } main().catch(console.error);
Debug
Known issues
breakingDatasquirel v2.0.0 introduced a new API structure; the 'post' method now requires a 'payload' object with 'action', 'table', 'data' fields instead of raw SQL string.
fix
Wrap SQL strings in an object: { action: 'select', sql: 'SELECT * FROM users' } or use the structured payload.
affects: >=2.0.0
gotchaAPI keys are exposed in client-side code; the package does not support server-side environment variable injection automatically.
fix
Always use environment variables (process.env.KEY) and never hardcode keys in source code.
affects: all
gotchaUsing a readonly key with 'post' method will fail silently or return an error; readonly keys only work with 'get' and SELECT queries.
fix
Ensure readonly keys are only used with datasquirel.get() and never with datasquirel.post().
affects: all
gotchaImage upload uses base64 encoding; large images may exceed payload limits or cause performance issues.
fix
Compress images before base64 encoding and consider chunked upload if available.
affects: all
Errors
Common errors & fixes
TypeError: datasquirel.get is not a function
Invalid import: using ESM import on a CommonJS package without default import.
fix
Use const datasquirel = require('datasquirel');
Error: Invalid API key
API key is missing, malformed, or lacks necessary permissions for the operation.
fix
Check that the key is set correctly and has the required access (readonly vs fullaccess).
Error: Database not found
The 'db' slug does not correspond to an existing database in your Datasquirel account.
fix
Verify the database name slug (lowercase, underscores instead of spaces) and ensure it exists.
Error: SQL syntax error
Invalid SQL query provided to get() or as payload string.
fix
Check SQL syntax and ensure only SELECT is used with readonly key.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
datasquirel — npm install datasquirel · libregistry