{"id":42586,"library":"datasquirel","title":"Datasquirel","description":"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.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/BenjaminToby/dsql","tags":["javascript","SQL","Cloud","Storage","API","Data"],"install":[{"cmd":"npm install datasquirel","lang":"bash","label":"npm"},{"cmd":"yarn add datasquirel","lang":"bash","label":"yarn"},{"cmd":"pnpm add datasquirel","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not ship ESM exports; use CommonJS require(). The default export is an object with get, post, uploadImage methods.","wrong":"import datasquirel from 'datasquirel';","symbol":"datasquirel","correct":"const datasquirel = require('datasquirel');"},{"note":"Accessing get directly without the default object may fail. Always use the default import.","wrong":"","symbol":"get","correct":"const result = await require('datasquirel').get({key: '...', db: '...', query: '...'});"},{"note":"Named exports not supported; must use default object.","wrong":"import { post } from 'datasquirel';","symbol":"post","correct":"const datasquirel = require('datasquirel'); const result = await datasquirel.post({key: '...', payload: {...}});"},{"note":"Only accessible through default import.","wrong":"import { uploadImage } from 'datasquirel';","symbol":"uploadImage","correct":"const datasquirel = require('datasquirel'); await datasquirel.uploadImage({key: '...', payload: {...}});"}],"quickstart":{"code":"const datasquirel = require('datasquirel');\n\nasync function main() {\n  // Fetch data with readonly key\n  const result = await datasquirel.get({\n    key: process.env.DATASQUIREL_READONLY_KEY ?? '',\n    db: 'my_database',\n    query: 'SELECT * FROM blog_posts'\n  });\n  console.log('Rows:', result);\n\n  // Insert data with full-access key\n  const insertResult = await datasquirel.post({\n    key: process.env.DATASQUIREL_FULLACCESS_KEY ?? '',\n    payload: {\n      action: 'insert',\n      table: 'users',\n      data: { user_id: '123', user_name: 'Jane Doe' }\n    }\n  });\n  console.log('Inserted:', insertResult);\n\n  // Upload an image\n  const imageResult = await datasquirel.uploadImage({\n    key: process.env.DATASQUIREL_FULLACCESS_KEY ?? '',\n    payload: {\n      imageData: Buffer.from('placeholder').toString('base64'),\n      imageName: 'sample',\n      mimeType: 'png'\n    }\n  });\n  console.log('Image uploaded:', imageResult);\n}\n\nmain().catch(console.error);","lang":"javascript","description":"Demonstrates read-only SELECT, INSERT, and image upload with both key types using CommonJS require."},"warnings":[{"fix":"Wrap SQL strings in an object: { action: 'select', sql: 'SELECT * FROM users' } or use the structured payload.","message":"Datasquirel 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.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always use environment variables (process.env.KEY) and never hardcode keys in source code.","message":"API keys are exposed in client-side code; the package does not support server-side environment variable injection automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure readonly keys are only used with datasquirel.get() and never with datasquirel.post().","message":"Using a readonly key with 'post' method will fail silently or return an error; readonly keys only work with 'get' and SELECT queries.","severity":"gotcha","affected_versions":"all"},{"fix":"Compress images before base64 encoding and consider chunked upload if available.","message":"Image upload uses base64 encoding; large images may exceed payload limits or cause performance issues.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.0.0':27 'abstract':69 'access':46 'account':52 'add':76 'api':16,47,108 'authent':62 'away':70 'base':7 'beyond':101 'call':89 'cloud':6,106 'cloud-bas':5 'compar':63 'complex':99 'connect':71 'data':9,23,109 'databas':66 'datasquirel':1,2,68 'datasquirel.com':54 'delet':32 'direct':65 'driver':67 'execut':18 'fetch':87 'fetch-lik':86 'full':45 'full-access':44 'https':25 'infrastructur':73 'insert':30 'interfac':37 'javascript':104 'join':100 'key':48 'latenc':77 'librari':82 'like':88 'limit':80 'manag':10,22,74 'minim':84 'oper':33 'provid':13 'queri':20,97 'rate':79 'read':41 'read-on':40 'real':95 'real-tim':94 'reli':56 'requir':50 'rest':36 'select':29 'separ':39 'server':60 'server-sid':59 'side':61 'simpl':15 'sole':57 'sql':8,19,103,105 'standard':102 'storag':107 'support':28,93 'time':96 'tool':11 'updat':31 'version':26 'via':34 'wrap':85","created_at":"2026-06-05T16:55:42.042956+00:00","updated_at":"2026-06-05T16:55:42.042956+00:00","problems":[{"fix":"Use const datasquirel = require('datasquirel');","cause":"Invalid import: using ESM import on a CommonJS package without default import.","error":"TypeError: datasquirel.get is not a function"},{"fix":"Check that the key is set correctly and has the required access (readonly vs fullaccess).","cause":"API key is missing, malformed, or lacks necessary permissions for the operation.","error":"Error: Invalid API key"},{"fix":"Verify the database name slug (lowercase, underscores instead of spaces) and ensure it exists.","cause":"The 'db' slug does not correspond to an existing database in your Datasquirel account.","error":"Error: Database not found"},{"fix":"Check SQL syntax and ensure only SELECT is used with readonly key.","cause":"Invalid SQL query provided to get() or as payload string.","error":"Error: SQL syntax error"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://datasquirel.com/","github":"https://github.com/BenjaminToby/dsql","docs":null,"changelog":null,"pypi":null,"npm":"datasquirel","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}