189 lines
85 KiB
JSON
189 lines
85 KiB
JSON
|
[
|
|||
|
{
|
|||
|
"id": 2,
|
|||
|
"title": "Quick Start",
|
|||
|
"slug": "quick-start",
|
|||
|
"description": "<p>Start saving and retrieving data now. Set up and start deploying in minutes.</p>",
|
|||
|
"content": "<h2>Starting up your Datasquirel instance</h2><p>To get started with datasquirel you need an account online. The datasquirel npm module will hit this account via out API integration using your API credentials. Without an account, you cannout query any data on our API. Follow these steps to create an account:</p><h3>1. Create Account</h3><p>Create a free account <a href=\"https://datasquirel.com/create-account\">here</a></p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/create-account.png\" width=\"800\" height=\"578\" /></p><p><br /></p><h3>2. Create Database</h3><p>Navigate to your <a href=\"https://datasquirel.com/admin\">Dashboard</a> or <a href=\"https://datasquirel.com/admin/databases\">Databases page</a>. Click the \"Add Database\" button to add a new database.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-2023-07-16-13_35_04.png\" width=\"800\" height=\"424\" /></p><p>On the next screen that appears, fill in the form and add a database image if you wish. Click on \"Create Database\" to add the new database</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-databases-add-database-2023-07-17-11_01_28.png\" width=\"800\" height=\"374\" /></p><p>Creating a new database takes you to the database page. This page allows you to import a pre-existing database using an SQL export file, or create a new table inside the newly-formed database. More operations for your database can be found in the database dropdown on the top left, or the \"more\" dropdown on the top right.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-databases-test-2023-07-17-11_09_52.png\" width=\"800\" height=\"374\" /></p><h3>3. Add a table</h3><p>Databases consists of Tables: each with fields(or columns) and entries(or rows). Select a database from your database list to access the single database pages. Click on \"Add Table\" and fill in the new table form.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-table-form.png\" width=\"800\" height=\"797\" /></p><p>On each table form you have access to the table fields(or column titles). Each field contains a few options:</p><ul><li><strong>Field Name</strong>: Name of field(or column title)</li><li><strong>Data Type</strong>: type of data to be stored on that field: <a class=\"inline\" href=\"docs/db-reference/data-types\">See All Datatypes</a></li><li><strong>Required</strong>: Choose whether the field must have a value or not</li><li><strong>Default Value</strong>: Default value of field in the case no value is entered.</li><li><strong>More:</strong> The \"More\" button contains options for encryption and foreign keys</li></ul><p>After these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/tables-list.png\" width=\"800\" height=\"374\" /></p><p>After creating a table you now have access to the tables list.</p><p><br /></p><h3>4. Add an Entry</h3><p>Select the newly created Table and on the designated table page click on \"Add New Table Entry\"</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/table-page.png\" width=\"800\" height=\"576\" /></p><p>Fill in the required fields and click on \"Add Entry\". Congrats, you have now created your first datasquirel data entry, you can now access this data from any platform using your api key.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-entry.png\" width=\"800\" height=\"633\" /></p><p><br /></p><h2>Fetching Data</h2><p>to start fetching data from your datasquirel account, you need to go through 3 steps:</p><h3>1. Create an API key</h3><p>Your api key is your gateway to all your data. There are two sets of API keys available for use: <strong>Read Only </strong>API keys
|
|||
|
"text_content": "Starting up your Datasquirel instance\n\nTo get started with datasquirel you need an account online. The datasquirel npm module will hit this account via out API integration using your API credentials. Without an account, you cannout query any data on our API. Follow these steps to create an account:\n\n1. Create Account\n\nCreate a free account here\n\n\n\n\n2. Create Database\n\nNavigate to your Dashboard or Databases page. Click the \"Add Database\" button to add a new database.\n\nOn the next screen that appears, fill in the form and add a database image if you wish. Click on \"Create Database\" to add the new database\n\nCreating a new database takes you to the database page. This page allows you to import a pre-existing database using an SQL export file, or create a new table inside the newly-formed database. More operations for your database can be found in the database dropdown on the top left, or the \"more\" dropdown on the top right.\n\n3. Add a table\n\nDatabases consists of Tables: each with fields(or columns) and entries(or rows). Select a database from your database list to access the single database pages. Click on \"Add Table\" and fill in the new table form.\n\nOn each table form you have access to the table fields(or column titles). Each field contains a few options:\n\nField Name: Name of field(or column title)\nData Type: type of data to be stored on that field: \nSee All Datatypes\nRequired: Choose whether the field must have a value or not\nDefault Value: Default value of field in the case no value is entered.\nMore: The \"More\" button contains options for encryption and foreign keys\n\nAfter these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.\n\nAfter creating a table you now have access to the tables list.\n\n\n\n\n4. Add an Entry\n\nSelect the newly created Table and on the designated table page click on \"Add New Table Entry\"\n\nFill in the required fields and click on \"Add Entry\". Congrats, you have now created your first datasquirel data entry, you can now access this data from any platform using your api key.\n\n\n\n\nFetching Data\n\nto start fetching data from your datasquirel account, you need to go through 3 steps:\n\n1. Create an API key\n\nYour api key is your gateway to all your data. There are two sets of API keys available for use: Read Only API keys, and Full Access API keys. They function as their names sound: Read only API keys only read data, Full Access API keys can read, write, delete, update, and also add media to your media storage directory.\n\nTo create an API key, follow these steps:\n\nLogin to your admin dashboard and navigate to \"API keys\" page\n\n\nClick on \"Add API key\" and fill in the form. Give your API key a name and select which the scope you wich to cover with the key (\"Read Only\" for just reading data, \"Full Access\" for reading and writing data).\n\n\nOnce your API key is created, copy the API key by clicking \"Copy API key\". Keep this key safe and secured.\n\n\n\n\n2. Use your API key to make a request\n\nAfter creating your API key, then comes the backend section.\n\nFirst add the datasquirel package via NPM\n\n\nnpm install datasquirel\nNext import the datasquirel module into your project, choose the database you will be querying, add your API key, and then run the query.\n\n\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .get({\n db: \"test\",\n key: process.env.DATASQUIREL_READ_ONLY_KEY,\n query: \"SELECT title, slug, body FROM blog_posts\",\n })\n .then((response) => {\n console.log(response);\n });\n\nRead our API Reference for more.",
|
|||
|
"level": 1,
|
|||
|
"page_order": 2,
|
|||
|
"parent_id": null,
|
|||
|
"date_created": "Sat Jul 15 2023 19:40:56 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689446456874,
|
|||
|
"date_created_timestamp": "2023-07-15T18:40:56.000Z",
|
|||
|
"date_updated": "Wed Jul 19 2023 07:25:57 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689747957328,
|
|||
|
"date_updated_timestamp": "2023-07-19T06:25:57.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 3,
|
|||
|
"title": "GUI Reference",
|
|||
|
"slug": "gui-reference",
|
|||
|
"description": "<p>Datasquirel Graphic User Interface provides a way to manage database instances from your browser</p>",
|
|||
|
"content": "<p>A lot can be done using our web interface. Everyhing going on you admin dashboard is essentially running SQL queries on your isolated database, and saving and retrieving static files. Our integrated SQL shell for each database takes this concept to the next level. Giving you the ability to run SQL queries directly via your browser. To get started using our GUI, follow these steps:</p><h3>1. Create Account</h3><p>Create a free account <a href=\"../../../create-account\">here</a></p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/create-account.png\" width=\"700\" height=\"506\" /></p><p><br /></p><h3>2. Create Database</h3><p>Navigate to your <a href=\"../../../admin\">Dashboard</a> or <a href=\"../../../admin/databases\">Databases page</a>. Click the \"Add Database\" button to add a new database.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-2023-07-16-13_35_04.png\" width=\"700\" height=\"371\" /></p><p>On the next screen that appears, fill in the form and add a database image if you wish. Click on \"Create Database\" to add the new database</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-databases-add-database-2023-07-17-11_01_28.png\" width=\"700\" height=\"327\" /></p><p>Creating a new database takes you to the database page. This page allows you to import a pre-existing database using an SQL export file, or create a new table inside the newly-formed database. More operations for your database can be found in the database dropdown on the top left, or the \"more\" dropdown on the top right.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-databases-test-2023-07-17-11_09_52.png\" width=\"700\" height=\"327\" /></p><h3>3. Add a table</h3><p>Databases consists of Tables: each with fields(or columns) and entries(or rows). Select a database from your database list to access the single database pages. Click on \"Add Table\" and fill in the new table form.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-table-form.png\" width=\"700\" height=\"697\" /></p><p>On each table form you have access to the table fields(or column titles). Each field contains a few options:</p><ul><li><strong>Field Name</strong>: Name of field(or column title)</li><li><strong>Data Type</strong>: type of data to be stored on that field: <a class=\"inline\" href=\"docs/db-reference/data-types\">See All Datatypes</a></li><li><strong>Required</strong>: Choose whether the field must have a value or not</li><li><strong>Default Value</strong>: Default value of field in the case no value is entered.</li><li><strong>More:</strong> The \"More\" button contains options for encryption and foreign keys</li></ul><p>After these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/tables-list.png\" width=\"700\" height=\"327\" /></p><p>After creating a table you now have access to the tables list.</p><p><br /></p><h3>4. Add an Entry</h3><p>Select the newly created Table and on the designated table page click on \"Add New Table Entry\"</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/table-page.png\" width=\"700\" height=\"504\" /></p><p>Fill in the required fields and click on \"Add Entry\". Congrats, you have now created your first datasquirel data entry, you can now access this data from any platform using your api key.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-entry.png\" width=\"700\" height=\"554\" /></p>",
|
|||
|
"text_content": "A lot can be done using our web interface. Everyhing going on you admin dashboard is essentially running SQL queries on your isolated database, and saving and retrieving static files. Our integrated SQL shell for each database takes this concept to the next level. Giving you the ability to run SQL queries directly via your browser. To get started using our GUI, follow these steps:\n\n1. Create Account\n\nCreate a free account here\n\n\n\n\n2. Create Database\n\nNavigate to your Dashboard or Databases page. Click the \"Add Database\" button to add a new database.\n\nOn the next screen that appears, fill in the form and add a database image if you wish. Click on \"Create Database\" to add the new database\n\nCreating a new database takes you to the database page. This page allows you to import a pre-existing database using an SQL export file, or create a new table inside the newly-formed database. More operations for your database can be found in the database dropdown on the top left, or the \"more\" dropdown on the top right.\n\n3. Add a table\n\nDatabases consists of Tables: each with fields(or columns) and entries(or rows). Select a database from your database list to access the single database pages. Click on \"Add Table\" and fill in the new table form.\n\nOn each table form you have access to the table fields(or column titles). Each field contains a few options:\n\nField Name: Name of field(or column title)\nData Type: type of data to be stored on that field: \nSee All Datatypes\nRequired: Choose whether the field must have a value or not\nDefault Value: Default value of field in the case no value is entered.\nMore: The \"More\" button contains options for encryption and foreign keys\n\nAfter these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.\n\nAfter creating a table you now have access to the tables list.\n\n\n\n\n4. Add an Entry\n\nSelect the newly created Table and on the designated table page click on \"Add New Table Entry\"\n\nFill in the required fields and click on \"Add Entry\". Congrats, you have now created your first datasquirel data entry, you can now access this data from any platform using your api key.",
|
|||
|
"level": 1,
|
|||
|
"page_order": 3,
|
|||
|
"parent_id": null,
|
|||
|
"date_created": "Sat Jul 15 2023 19:54:47 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689447287434,
|
|||
|
"date_created_timestamp": "2023-07-15T18:54:47.000Z",
|
|||
|
"date_updated": "Tue Jul 18 2023 15:08:22 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689689302628,
|
|||
|
"date_updated_timestamp": "2023-07-18T14:08:22.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 4,
|
|||
|
"title": "API Reference",
|
|||
|
"slug": "api-reference",
|
|||
|
"description": "<p>Access data from external sources. Datasquirel is platform-agnostic so all you need is a HTTP request with the right credentials. Our NPM module abstracts this aspect for ease of use when using node.</p>",
|
|||
|
"content": "<h2>Overview</h2><p>All data stored in your databases can be accessed through our integrated API. There are two sets of API keys, each with different scope. If you want to just fetch data use the <strong>Read Only </strong>API key. If you want to have full access to every aspect of your account, use the <strong>Full Access </strong>API key. Learn how to add API keys <a href=\"docs/quick-start\">here</a>.</p><p><br /></p><h2>Getting started</h2><p>After you have your API keys, you can start making calls using our API integration. We have an NPM module for node projects, but you only need a HTTPS client to make the calls.</p><pre class=\"language-markup\">npm install datasquirel</pre><h2><br /></h2><h2>Fetching Data using the <em>get</em> method</h2><p>The get method only retrieves data. It cannot be used to write or update data. It was created to be the fastest way to access your data, that explains the key length. You can get data using the npm module or via any HTTP request.</p><ul><li>Using CURL:<br /><br /><pre class=\"language-markup\">CURL \n https://datasquirel.com/api/query/get?db=db_name&query=SELECT+*+FROM+table_name \n-H \n \"Authorization:READ_ONLY_API_KEY\";Content-Type:application/json</pre></li><li>Using node module<br /><br /><pre class=\"language-javascript\"><span class=\"token keyword\">const</span> datasquirel <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"datasquirel\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\ndatasquirel\n <span class=\"token punctuation\">.</span><span class=\"token function\">get</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">db</span><span class=\"token operator\">:</span> <span class=\"token string\">\"test\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">key</span><span class=\"token operator\">:</span> process<span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">.</span><span class=\"token constant\">DATASQUIREL_READ_ONLY_KEY</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">query</span><span class=\"token operator\">:</span> <span class=\"token string\">\"SELECT title, slug, body FROM blog_posts\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">response</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>response<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></pre></li></ul><p>The response from this method returns a JSON payload with two fields: <strong>success</strong>: which could be either <code style=\"display:inline\">true</code> or <code style=\"display:inline\">false</code>, and <strong>payload: </strong>which is an array of values when the operation is successfull, or anything from <code style=\"display:inline\">null</code> to a string to an object with an error message. This is a sample of a successful response object:</p><pre class=\"language-javascript\"><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">success</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span><span c
|
|||
|
"text_content": "Overview\n\nAll data stored in your databases can be accessed through our integrated API. There are two sets of API keys, each with different scope. If you want to just fetch data use the Read Only API key. If you want to have full access to every aspect of your account, use the Full Access API key. Learn how to add API keys here.\n\n\n\n\nGetting started\n\nAfter you have your API keys, you can start making calls using our API integration. We have an NPM module for node projects, but you only need a HTTPS client to make the calls.\n\nnpm install datasquirel\n\n\nFetching Data using the get method\n\nThe get method only retrieves data. It cannot be used to write or update data. It was created to be the fastest way to access your data, that explains the key length. You can get data using the npm module or via any HTTP request.\n\nUsing CURL:\n\n\nCURL \n https://datasquirel.com/api/query/get?db=db_name&query=SELECT+*+FROM+table_name \n-H \n \"Authorization:READ_ONLY_API_KEY\";Content-Type:application/json\nUsing node module\n\n\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .get({\n db: \"test\",\n key: process.env.DATASQUIREL_READ_ONLY_KEY,\n query: \"SELECT title, slug, body FROM blog_posts\",\n })\n .then((response) => {\n console.log(response);\n });\n\nThe response from this method returns a JSON payload with two fields: success: which could be either true or false, and payload: which is an array of values when the operation is successfull, or anything from null to a string to an object with an error message. This is a sample of a successful response object:\n\n{\n success: true,\n payload: [\n {\n id: 1,\n title: \"Hello World\",\n slug: \"hello-world\",\n body: \"This is a test blog post.\",\n },\n ],\n}\n\nA failed response could return any of three results:\n\nA null payload.\n\n\n{\n success: false,\n payload: null\n}\n\n\nAn error string payload\n\n\n{\n success: false,\n payload: \"ERROR: no such table as 'blog_posts'\"\n}\nAn object payload containing an error field\n\n\n{\n success: false,\n payload: { error: \"MYSQL ERROR: syntax error in your sql\" }\n}\n\nIn each case, the success key refurns a value of false , meaning the query failed.\n\n\n\n\nUsing the post method\n\nThe post method contains the full spectrum of CRUD operations. And it works *only with the Full Access API key. The read only API key will not work for post methods.\n\nUsing CURL\n\nCURL --json\n '{ \n \"database\": \"social_network\",\n \"query\": \"UPDATE users SET name = 'John' WHERE id = 1\"\n }'\n https://datasquirel.com/api/query/post \n-H \n \"Authorization:FULL_ACCESS_API_KEY\"`\n\n\nUsing our npm module\n\n\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .post({\n database: \"social_network\",\n key: process.env.FULL_ACCESS_API_KEY,\n query: \"UPDATE users SET name = 'John' WHERE id = 1\",\n })\n .then((response) => {\n console.log(response);\n });\n\nThe process yeilds simalar results, but with a slight difference: for operations like insert and update, the success field yeilds true while the payload field yeilds an object containing fields like \n\n{\n success: true,\n payload: {\n serverStatus: 37,\n affectedRows: 1,\n }\n}\n\nThe post method can also take an object as the query instead of a string. Example:\n\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .post({\n database: \"social_network\",\n key: process.env.FULL_ACCESS_API_KEY,\n query: {\n action: \"update\",\n table: \"users\",\n data: {\n name: \"John\",\n },\n identifierColumnName: \"id\",\n identifierValue: 1,\n },\n })\n .then((response) => {\n console.log(response);\n });\n\nThis yields the exact same result as before. Learn
|
|||
|
"level": 1,
|
|||
|
"page_order": 4,
|
|||
|
"parent_id": null,
|
|||
|
"date_created": "Sat Jul 15 2023 19:55:22 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689447322376,
|
|||
|
"date_created_timestamp": "2023-07-15T18:55:22.000Z",
|
|||
|
"date_updated": "Tue Jul 18 2023 14:31:32 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689687092818,
|
|||
|
"date_updated_timestamp": "2023-07-18T13:31:32.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 8,
|
|||
|
"title": "Getting Started",
|
|||
|
"slug": "getting-started",
|
|||
|
"description": "<p>Introduction to datasquirel. Read the <a href=\"../../../docs/quick-start\">quick-start guide</a> to get started with a new account.</p>",
|
|||
|
"content": "<h2>Overview<a href=\"https://vitejs.dev/guide/#overview\"></a></h2><p>Datasquirel is an SQL-based data management system that aims to manage SQL databases with the lowest level of opinionation. Datasquirel consists of 2 main parts:</p><ol><li>A full-fledged SQL server that runs multiple isolated databases for different users, interfacing with an online Graphical user interface and a REST API integration.</li><li>An all-purpose static files server using NGINX to serve static files on demand. Files uploaded to datasquirel static file server are public by default, but the can be made private, in which case they can only be accessed via secure encrypted credentials.</li></ol><div style=\"flex-wrap:wrap;max-width:800px\"><div style=\"padding:30px;border-radius:5px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;background-color:rgb(246, 244, 248);position:relative;overflow:hidden;flex-grow:1\"><h3 style=\"margin:0px;color:rgb(30, 41, 59)\">GUI Reference</h3><div>SQL through your bowser</div><a href=\"../../../docs/gui-reference\" class=\"button\">Learn More</a> <img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/icons/ui-design.png\" style=\"position:absolute;bottom:-100px;right:-50px;opacity:0.2\" width=\"250\" height=\"250\" /></div></div><p>Datasquirel's Graphical User Interface aims to narrow down the the complexities of SQL to a simple user interface with columns, rows, and entries.</p><div style=\"flex-wrap:wrap;max-width:800px\"><div style=\"padding:30px;border-radius:5px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;background-color:rgb(246, 244, 248);position:relative;overflow:hidden;flex-grow:1\"><h3 style=\"margin:0px;color:rgb(30, 41, 59)\">API Reference</h3><div>SQL over the cloud using REST</div><a href=\"../../../docs/api-reference\" class=\"button\">Learn More</a> <img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/icons/world-wide-web.png\" style=\"position:absolute;bottom:-100px;right:-50px;opacity:0.2\" width=\"250\" height=\"250\" /></div></div><p>Datasquirel's API reference uses our NPM module <a href=\"https://www.npmjs.com/package/datasquirel\">datasquirel</a>. This can be installed via npm:</p><pre class=\"language-markup\">npm install datasquirel</pre><p>Learn more by reading the <a href=\"docs/api-reference\">api documentation</a></p><h2><br /></h2><h2>Key Concepts</h2><h3>SQL</h3><p>SQL stands for \"Sequential Query language\". This is the standard language for relational databases like MySQL and Postgres. Datasquirel uses MySQL and is compatible with all known SQL syntax.</p><h3>Database</h3><p>A database in datasquirel is an isolated MySQL database running on our MySQL servers. A database consists of tables, which in turn consists of columns, rows, and entries. Each database can be exported at anytime, and also populated using a .sql dump file at any time.</p><h3>CRUD</h3><p>CRUD stands for <strong>Create, Read, Update, Delete</strong>. This is the basic spectrum of the capabilities of any database, and it is useful for managing data.</p>",
|
|||
|
"text_content": "Overview\n\nDatasquirel is an SQL-based data management system that aims to manage SQL databases with the lowest level of opinionation. Datasquirel consists of 2 main parts:\n\nA full-fledged SQL server that runs multiple isolated databases for different users, interfacing with an online Graphical user interface and a REST API integration.\nAn all-purpose static files server using NGINX to serve static files on demand. Files uploaded to datasquirel static file server are public by default, but the can be made private, in which case they can only be accessed via secure encrypted credentials.\nGUI Reference\nSQL through your bowser\nLearn More\n\nDatasquirel's Graphical User Interface aims to narrow down the the complexities of SQL to a simple user interface with columns, rows, and entries.\n\nAPI Reference\nSQL over the cloud using REST\nLearn More\n\nDatasquirel's API reference uses our NPM module datasquirel. This can be installed via npm:\n\nnpm install datasquirel\n\nLearn more by reading the api documentation\n\n\n\nKey Concepts\nSQL\n\nSQL stands for \"Sequential Query language\". This is the standard language for relational databases like MySQL and Postgres. Datasquirel uses MySQL and is compatible with all known SQL syntax.\n\nDatabase\n\nA database in datasquirel is an isolated MySQL database running on our MySQL servers. A database consists of tables, which in turn consists of columns, rows, and entries. Each database can be exported at anytime, and also populated using a .sql dump file at any time.\n\nCRUD\n\nCRUD stands for Create, Read, Update, Delete. This is the basic spectrum of the capabilities of any database, and it is useful for managing data.",
|
|||
|
"level": 1,
|
|||
|
"page_order": 1,
|
|||
|
"parent_id": null,
|
|||
|
"date_created": "Sun Jul 16 2023 18:18:08 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689527888337,
|
|||
|
"date_created_timestamp": "2023-07-16T17:18:08.000Z",
|
|||
|
"date_updated": "Thu Jul 20 2023 21:35:26 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689885326495,
|
|||
|
"date_updated_timestamp": "2023-07-20T20:35:26.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 9,
|
|||
|
"title": "Getting Started",
|
|||
|
"slug": "getting-started",
|
|||
|
"description": "<p>Get started creating databases and making entries.</p>",
|
|||
|
"content": "<h2>Overview</h2><p>Datasquirel GUI is focused on the process of creating databases, defining and adding tables, and adding entries to these tables. We will go through these steps here.</p><p><br /></p><h2>1. Create Account</h2><p>Create a free account <a href=\"../../../create-account\">here</a></p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/create-account.png\" width=\"700\" height=\"506\" /></p><p><br /></p><h2>2. Create Database</h2><p>Navigate to your <a href=\"../../../admin\">Dashboard</a> or <a href=\"../../../admin/databases\">Databases page</a>. Click the \"Add Database\" button to add a new database.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-2023-07-16-13_35_04.png\" width=\"700\" height=\"371\" /></p><p>On the next screen that appears, fill in the form and add a database image if you wish. Click on \"Create Database\" to add the new database</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-databases-add-database-2023-07-17-11_01_28.png\" width=\"700\" height=\"327\" /></p><p>Creating a new database takes you to the database page. This page allows you to import a pre-existing database using an SQL export file, or create a new table inside the newly-formed database. More operations for your database can be found in the database dropdown on the top left, or the \"more\" dropdown on the top right.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/screencapture-localhost-7070-admin-databases-test-2023-07-17-11_09_52.png\" width=\"700\" height=\"327\" /></p><h2>3. Add a table</h2><p>Databases consists of Tables: each with fields(or columns) and entries(or rows). Select a database from your database list to access the single database pages. Click on \"Add Table\" and fill in the new table form.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-table-form.png\" width=\"700\" height=\"697\" /></p><p>On each table form you have access to the table fields(or column titles). Each field contains a few options:</p><ul><li><strong>Field Name</strong>: Name of field(or column title)</li><li><strong>Data Type</strong>: type of data to be stored on that field: <a class=\"inline\" href=\"docs/db-reference/data-types\">See All Datatypes</a></li><li><strong>Required</strong>: Choose whether the field must have a value or not</li><li><strong>Default Value</strong>: Default value of field in the case no value is entered.</li><li><strong>More:</strong> The \"More\" button contains options for encryption and foreign keys</li></ul><p>After these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/tables-list.png\" width=\"700\" height=\"327\" /></p><p>After creating a table you now have access to the tables list.</p><p><br /></p><h2>4. Add an Entry</h2><p>Select the newly created Table and on the designated table page click on \"Add New Table Entry\"</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/table-page.png\" width=\"700\" height=\"504\" /></p><p>Fill in the required fields and click on \"Add Entry\". Congrats, you have now created your first datasquirel data entry, you can now access this data from any platform using your api key.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-entry.png\" width=\"700\" height=\"554\" /></p>",
|
|||
|
"text_content": "Overview\n\nDatasquirel GUI is focused on the process of creating databases, defining and adding tables, and adding entries to these tables. We will go through these steps here.\n\n\n\n\n1. Create Account\n\nCreate a free account here\n\n\n\n\n2. Create Database\n\nNavigate to your Dashboard or Databases page. Click the \"Add Database\" button to add a new database.\n\nOn the next screen that appears, fill in the form and add a database image if you wish. Click on \"Create Database\" to add the new database\n\nCreating a new database takes you to the database page. This page allows you to import a pre-existing database using an SQL export file, or create a new table inside the newly-formed database. More operations for your database can be found in the database dropdown on the top left, or the \"more\" dropdown on the top right.\n\n3. Add a table\n\nDatabases consists of Tables: each with fields(or columns) and entries(or rows). Select a database from your database list to access the single database pages. Click on \"Add Table\" and fill in the new table form.\n\nOn each table form you have access to the table fields(or column titles). Each field contains a few options:\n\nField Name: Name of field(or column title)\nData Type: type of data to be stored on that field: \nSee All Datatypes\nRequired: Choose whether the field must have a value or not\nDefault Value: Default value of field in the case no value is entered.\nMore: The \"More\" button contains options for encryption and foreign keys\n\nAfter these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.\n\nAfter creating a table you now have access to the tables list.\n\n\n\n\n4. Add an Entry\n\nSelect the newly created Table and on the designated table page click on \"Add New Table Entry\"\n\nFill in the required fields and click on \"Add Entry\". Congrats, you have now created your first datasquirel data entry, you can now access this data from any platform using your api key.",
|
|||
|
"level": 2,
|
|||
|
"page_order": 1,
|
|||
|
"parent_id": 3,
|
|||
|
"date_created": "Mon Jul 17 2023 06:32:58 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689571978660,
|
|||
|
"date_created_timestamp": "2023-07-17T05:32:58.000Z",
|
|||
|
"date_updated": "Thu Jul 20 2023 03:57:28 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689821848831,
|
|||
|
"date_updated_timestamp": "2023-07-20T02:57:28.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 10,
|
|||
|
"title": "Get",
|
|||
|
"slug": "get",
|
|||
|
"description": "<p>Fetch data from your database quickly and securely.</p>",
|
|||
|
"content": "<h2>Overview</h2><p>The get method only retrieves data. It cannot be used to write or update data. It was created to be the fastest way to access your data, that explains the key length. You can get data using the npm module or via any HTTP request.</p><h3>Using CURL</h3><pre class=\"language-markup\">CURL \n https://datasquirel.com/api/query/get?db=db_name&query=SELECT+*+FROM+table_name \n-H \n \"Authorization:READ_ONLY_API_KEY\";Content-Type:application/json</pre><h3><br /></h3><h3>Using node module</h3><pre class=\"language-javascript\"><span class=\"token keyword\">const</span> datasquirel <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"datasquirel\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\ndatasquirel\n <span class=\"token punctuation\">.</span><span class=\"token function\">get</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">db</span><span class=\"token operator\">:</span> <span class=\"token string\">\"test\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">key</span><span class=\"token operator\">:</span> process<span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">.</span><span class=\"token constant\">DATASQUIREL_READ_ONLY_KEY</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">query</span><span class=\"token operator\">:</span> <span class=\"token string\">\"SELECT title, slug, body FROM blog_posts\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">response</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>response<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></pre><p><br /></p><h2>The response</h2><p>The response from this method returns a JSON payload with two fields: <strong>success</strong>: which could be either <code style=\"display:inline\">true</code> or <code style=\"display:inline\">false</code>, and <strong>payload: </strong>which is an array of values when the operation is successfull, or anything from <code style=\"display:inline\">null</code> to a string to an object with an error message. This is a sample of a successful response object:</p><pre class=\"language-javascript\"><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">success</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">payload</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n <span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">id</span><span class=\"token operator\">:</span> <span class=\"token number\">1</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">title</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Hello World\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">slug</span><span class=\"token opera
|
|||
|
"text_content": "Overview\n\nThe get method only retrieves data. It cannot be used to write or update data. It was created to be the fastest way to access your data, that explains the key length. You can get data using the npm module or via any HTTP request.\n\nUsing CURL\nCURL \n https://datasquirel.com/api/query/get?db=db_name&query=SELECT+*+FROM+table_name \n-H \n \"Authorization:READ_ONLY_API_KEY\";Content-Type:application/json\n\n\nUsing node module\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .get({\n db: \"test\",\n key: process.env.DATASQUIREL_READ_ONLY_KEY,\n query: \"SELECT title, slug, body FROM blog_posts\",\n })\n .then((response) => {\n console.log(response);\n });\n\n\n\n\nThe response\n\nThe response from this method returns a JSON payload with two fields: success: which could be either true or false, and payload: which is an array of values when the operation is successfull, or anything from null to a string to an object with an error message. This is a sample of a successful response object:\n\n{\n success: true,\n payload: [\n {\n id: 1,\n title: \"Hello World\",\n slug: \"hello-world\",\n body: \"This is a test blog post.\",\n },\n ],\n}\n\nA failed response could return any of three results:\n\nA null payload.\n\n\n{\n success: false,\n payload: null\n}\nAn error string payload\n\n\n{\n success: false,\n payload: \"ERROR: no such table as 'blog_posts'\"\n}\nAn object payload containing an error field\n\n\n{\n success: false,\n payload: { error: \"MYSQL ERROR: syntax error in your sql\" }\n}\n\nIn each case, the success key refurns a value of false , meaning the query failed.\n\n\n",
|
|||
|
"level": 2,
|
|||
|
"page_order": 5,
|
|||
|
"parent_id": 4,
|
|||
|
"date_created": "Tue Jul 18 2023 14:32:48 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689687168877,
|
|||
|
"date_created_timestamp": "2023-07-18T13:32:48.000Z",
|
|||
|
"date_updated": "Tue Jul 18 2023 15:11:17 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689689477216,
|
|||
|
"date_updated_timestamp": "2023-07-18T14:11:17.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 11,
|
|||
|
"title": "Post",
|
|||
|
"slug": "post",
|
|||
|
"description": "<p>Full CRUD operations on your database using our feature-rich API integration.</p>",
|
|||
|
"content": "<h2>Overview</h2><p>The <code style=\"display:inline\">post</code> method expands on the <code style=\"display:inline\">get</code> method. It adds the ability to insert, update, and delete data, as well as add and delete images from your static files directories.</p><p>The post method contains the full spectrum of CRUD operations. And it works <strong>*only </strong>with the <strong>Full Access </strong>API key. The read only API key will not work for post methods.</p><h3>Using CURL<br /></h3><pre class=\"language-markup\">CURL --json\n '{ \n \"database\": \"social_network\",\n \"query\": \"UPDATE users SET name = 'John' WHERE id = 1\"\n }'\n https://datasquirel.com/api/query/post \n-H \n \"Authorization:FULL_ACCESS_API_KEY\"`</pre><p><br /></p><h3>Using our npm module<br /></h3><pre class=\"language-javascript\"><span class=\"token keyword\">const</span> datasquirel <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"datasquirel\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\ndatasquirel\n <span class=\"token punctuation\">.</span><span class=\"token function\">post</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">database</span><span class=\"token operator\">:</span> <span class=\"token string\">\"social_network\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">key</span><span class=\"token operator\">:</span> process<span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">.</span><span class=\"token constant\">FULL_ACCESS_API_KEY</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">query</span><span class=\"token operator\">:</span> <span class=\"token string\">\"UPDATE users SET name = 'John' WHERE id = 1\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n <span class=\"token punctuation\">.</span><span class=\"token function\">then</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">response</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>response<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></pre><h2><br /></h2><h2>The Response</h2><p>The process yeilds simalar results, but with a slight difference: for operations like <strong>insert </strong>and <strong>update</strong>, the <code style=\"display:inline\">success</code> field yeilds <code style=\"display:inline\">true</code> while the <code style=\"display:inline\">payload</code> field yeilds an object containing fields like </p><pre class=\"language-javascript\"><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">success</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">payload</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">serverStatus</span><span class=\"token operator\">:</span> <span class=\"token number\">37</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">affectedRows</span><span class=\"token operator\">:</span> <span class=\"token number\">
|
|||
|
"text_content": "Overview\n\nThe post method expands on the get method. It adds the ability to insert, update, and delete data, as well as add and delete images from your static files directories.\n\nThe post method contains the full spectrum of CRUD operations. And it works *only with the Full Access API key. The read only API key will not work for post methods.\n\nUsing CURL\n\nCURL --json\n '{ \n \"database\": \"social_network\",\n \"query\": \"UPDATE users SET name = 'John' WHERE id = 1\"\n }'\n https://datasquirel.com/api/query/post \n-H \n \"Authorization:FULL_ACCESS_API_KEY\"`\n\n\n\n\nUsing our npm module\n\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .post({\n database: \"social_network\",\n key: process.env.FULL_ACCESS_API_KEY,\n query: \"UPDATE users SET name = 'John' WHERE id = 1\",\n })\n .then((response) => {\n console.log(response);\n });\n\n\nThe Response\n\nThe process yeilds simalar results, but with a slight difference: for operations like insert and update, the success field yeilds true while the payload field yeilds an object containing fields like \n\n{\n success: true,\n payload: {\n serverStatus: 37,\n affectedRows: 1,\n }\n}\n\n\n\n\nPost with object query\n\nThe post method can also take an object as the query instead of a string. Example:\n\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel\n .post({\n database: \"social_network\",\n key: process.env.FULL_ACCESS_API_KEY,\n query: {\n action: \"update\",\n table: \"users\",\n data: {\n name: \"John\",\n },\n identifierColumnName: \"id\",\n identifierValue: 1,\n },\n })\n .then((response) => {\n console.log(response);\n });\n\nThis yields the exact same result as before.\n\n\n\n\nAdding media\n\nIn addition to the full CRUD operations the post method offers, you can also add media to your static files directory. This uses the same post method, but with sligtly different parameters. Also, the media you send *must be in base64 format. You can use our npm client module to convert images and documents to base64 format.\n\nUsing our node module\nconst datasquirel = require(\"datasquirel\");\n\ndatasquirel.media\n .uploadImage({\n key: process.env.DATASQUIREL_FULL_ACCESS_API_KEY,\n payload: {\n imageData: \"--------- LONG BASE64 STRING ---------\",\n imageName: \"sunflower\",\n folder: \"flowers\", // Optional\n mimeType: \"jpeg\", // Optional\n thumbnailSize: 300, // Optional\n },\n })\n .then((response) => {\n console.log(response);\n });",
|
|||
|
"level": 2,
|
|||
|
"page_order": 6,
|
|||
|
"parent_id": 4,
|
|||
|
"date_created": "Tue Jul 18 2023 14:35:26 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689687326548,
|
|||
|
"date_created_timestamp": "2023-07-18T13:35:26.000Z",
|
|||
|
"date_updated": "Tue Jul 18 2023 15:20:33 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689690033537,
|
|||
|
"date_updated_timestamp": "2023-07-18T14:20:33.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 12,
|
|||
|
"title": "Database Reference",
|
|||
|
"slug": "database-reference",
|
|||
|
"description": "<p>Understanding SQL and its syntax.</p>",
|
|||
|
"content": "<h2>Overview</h2><p>SQL (Sequential Query Language) is the industry-standard, battle-tested database querying language used to interact with relational databases. While datasquirel aims to abstract much of it, knowing the basics is still very important to get the full power of datasquirel management system.</p>",
|
|||
|
"text_content": "Overview\n\nSQL (Sequential Query Language) is the industry-standard, battle-tested database querying language used to interact with relational databases. While datasquirel aims to abstract much of it, knowing the basics is still very important to get the full power of datasquirel management system.",
|
|||
|
"level": 1,
|
|||
|
"page_order": 5,
|
|||
|
"parent_id": null,
|
|||
|
"date_created": "Wed Jul 19 2023 06:17:16 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689743836797,
|
|||
|
"date_created_timestamp": "2023-07-19T05:17:16.000Z",
|
|||
|
"date_updated": "Wed Jul 19 2023 06:17:37 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689743857771,
|
|||
|
"date_updated_timestamp": "2023-07-19T05:17:37.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 13,
|
|||
|
"title": "Data types",
|
|||
|
"slug": "data-types",
|
|||
|
"description": "<p>Relational database data types</p>",
|
|||
|
"content": "<h2>VARCHAR</h2><p>The varchar datatype is probably the most commonly used datatype. It's basically text and numbers that max out at 255 characters. Varchar type is usually annoted in the form <code style=\"display:inline\">VARCHAR(20)</code> .</p>",
|
|||
|
"text_content": "VARCHAR\n\nThe varchar datatype is probably the most commonly used datatype. It's basically text and numbers that max out at 255 characters. Varchar type is usually annoted in the form VARCHAR(20) .",
|
|||
|
"level": 2,
|
|||
|
"page_order": 7,
|
|||
|
"parent_id": 12,
|
|||
|
"date_created": "Wed Jul 19 2023 06:20:56 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689744056896,
|
|||
|
"date_created_timestamp": "2023-07-19T05:20:56.000Z",
|
|||
|
"date_updated": "Wed Jul 19 2023 06:20:56 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689744056896,
|
|||
|
"date_updated_timestamp": "2023-07-19T05:20:56.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 14,
|
|||
|
"title": "Querying Data",
|
|||
|
"slug": "querying-data",
|
|||
|
"description": "<p>Using SQL to query data from your database</p>",
|
|||
|
"content": "<h2>Overview</h2><p>Querying data will eventually be the most common thing you do with your datasquirel account. So it's important to know some essential querying syntax, our node module abstraction will not give you the same level of control as direct sql querying.</p><h2>SELECT Keyword</h2><pre class=\"language-markup\">SELECT * FROM blog_posts</pre><p>The select keyword is the most basic and used keyword. In the example above, we're selecting every row(or entry) from the table <code style=\"display:inline\">blog_posts</code> . The \"*\" sign stands for \"all columns\". To dial down to specific columns, you can replace the \"*\" symbol with the column(s) you want to select. Example:</p><pre class=\"language-markup\">SELECT title, body FROM blog_posts</pre><p>This query only targets the <code style=\"display:inline\">title</code> and <code style=\"display:inline\">body</code> columns(or fields) in the <code style=\"display:inline\">blog_posts</code> table.</p>",
|
|||
|
"text_content": "Overview\n\nQuerying data will eventually be the most common thing you do with your datasquirel account. So it's important to know some essential querying syntax, our node module abstraction will not give you the same level of control as direct sql querying.\n\nSELECT Keyword\nSELECT * FROM blog_posts\n\nThe select keyword is the most basic and used keyword. In the example above, we're selecting every row(or entry) from the table blog_posts . The \"*\" sign stands for \"all columns\". To dial down to specific columns, you can replace the \"*\" symbol with the column(s) you want to select. Example:\n\nSELECT title, body FROM blog_posts\n\nThis query only targets the title and body columns(or fields) in the blog_posts table.",
|
|||
|
"level": 2,
|
|||
|
"page_order": 8,
|
|||
|
"parent_id": 12,
|
|||
|
"date_created": "Wed Jul 19 2023 06:30:38 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689744638622,
|
|||
|
"date_created_timestamp": "2023-07-19T05:30:38.000Z",
|
|||
|
"date_updated": "Wed Jul 19 2023 06:30:38 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689744638622,
|
|||
|
"date_updated_timestamp": "2023-07-19T05:30:38.000Z"
|
|||
|
},
|
|||
|
{
|
|||
|
"id": 15,
|
|||
|
"title": "Upload Media",
|
|||
|
"slug": "upload-media",
|
|||
|
"description": "<p>Datasquirel comes baked with an integrated static file directory. This makes it easy to upload public and private files and access it from anywhere.</p>",
|
|||
|
"content": "<h2>Overview</h2><p>Media management is a bigger problem than it sounds at first. Images tend to get out of hand when adding them to web projects: your images need to be well optimized for fast loading, easily accessible, and maintain clarity so that your website doesn't look like it's from the 80's. Datasquirel does this all for you in a few clicks.</p><h2>Adding Media</h2><p>Every datasquirel account is created with two directories for media storage: one is public, and the other is private. To start adding media, follow these steps:</p><h3>1. Navigate to \"<strong>Media\" </strong>from your dashboard</h3><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/media-page-with-folder.png\" width=\"800\" height=\"373\" /></p><p>If you created a database already, with an image for this database, your media folder will be pre-populated with a folder named after your database (<code style=\"display:inline\">test</code> in this case), and it will contain the image you uploaded when you created the database. </p><h3>2. Select Media files</h3><p>To add a new media, click on <strong>Add Media</strong> button. This will open a modal for you to choose which type of media you want to add.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/chose-media-type-to-upload.png\" width=\"800\" height=\"373\" /></p><p>There are two options available at this time: <strong>Images</strong>, and <strong>Files</strong>. Image uploads only allow the image types listed in the description, the same applies with files. Click on the desired type and select the files you want to upload. You can upload multiple files at the same time.</p><h3>3. Edit selected files and upload files</h3><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/select-images-to-upload.png\" width=\"800\" height=\"373\" /></p><p>The next modal gives you the option to further change attributes of the images before uploading. These attributes include the <strong>image name</strong>, and <strong>privacy</strong>. Private images can only be accessed via out API using your <strong>Read Only </strong>or <strong>Full Access</strong> API keys.</p><p>After you're set, click on \"Upload Media\". This process uploads selected media to their respective directories. But that's not all, each media is compressed automatically, using a max width of <strong>1800px</strong>, and each media comes with an automatically generated thumbnail. So For each image you upload, you have two images. The thumbnail image contains a suffix <code style=\"display:inline\">_thumbnail</code> added to the original image's name.</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/media-with-added-images.png\" width=\"800\" height=\"599\" /></p><p>After images have been uploaded, you can now copy the link for *public images and share anywhere, you can also copy the thumbnail link. NOTE, you cannot share private images publicly, private images don't have a public URL, they can only be accessed through OUR API with valid credentials.</p><p><br /></p><h2>Adding Folders</h2><p>Adding folders help to better organize media. We currently have 2 depths of folder structure. So you can create a folder, and a sub-folder. To create a folder, simply navigate to your <strong>Media </strong>admin page and click \"<strong>Add Folder</strong>\".</p><p><img src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-folder-screen.png\" width=\"800\" height=\"376\" /></p><p>Add a folder name and click \"<strong>Add New Folder</strong>\". Your new folder is now ready to go. Click on the new folder and you can upload images and files to that folder.</p>",
|
|||
|
"text_content": "Overview\n\nMedia management is a bigger problem than it sounds at first. Images tend to get out of hand when adding them to web projects: your images need to be well optimized for fast loading, easily accessible, and maintain clarity so that your website doesn't look like it's from the 80's. Datasquirel does this all for you in a few clicks.\n\nAdding Media\n\nEvery datasquirel account is created with two directories for media storage: one is public, and the other is private. To start adding media, follow these steps:\n\n1. Navigate to \"Media\" from your dashboard\n\nIf you created a database already, with an image for this database, your media folder will be pre-populated with a folder named after your database (test in this case), and it will contain the image you uploaded when you created the database. \n\n2. Select Media files\n\nTo add a new media, click on Add Media button. This will open a modal for you to choose which type of media you want to add.\n\nThere are two options available at this time: Images, and Files. Image uploads only allow the image types listed in the description, the same applies with files. Click on the desired type and select the files you want to upload. You can upload multiple files at the same time.\n\n3. Edit selected files and upload files\n\nThe next modal gives you the option to further change attributes of the images before uploading. These attributes include the image name, and privacy. Private images can only be accessed via out API using your Read Only or Full Access API keys.\n\nAfter you're set, click on \"Upload Media\". This process uploads selected media to their respective directories. But that's not all, each media is compressed automatically, using a max width of 1800px, and each media comes with an automatically generated thumbnail. So For each image you upload, you have two images. The thumbnail image contains a suffix _thumbnail added to the original image's name.\n\nAfter images have been uploaded, you can now copy the link for *public images and share anywhere, you can also copy the thumbnail link. NOTE, you cannot share private images publicly, private images don't have a public URL, they can only be accessed through OUR API with valid credentials.\n\n\n\n\nAdding Folders\n\nAdding folders help to better organize media. We currently have 2 depths of folder structure. So you can create a folder, and a sub-folder. To create a folder, simply navigate to your Media admin page and click \"Add Folder\".\n\nAdd a folder name and click \"Add New Folder\". Your new folder is now ready to go. Click on the new folder and you can upload images and files to that folder.",
|
|||
|
"level": 2,
|
|||
|
"page_order": 9,
|
|||
|
"parent_id": 3,
|
|||
|
"date_created": "Wed Jul 19 2023 06:38:04 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_created_code": 1689745084387,
|
|||
|
"date_created_timestamp": "2023-07-19T05:38:04.000Z",
|
|||
|
"date_updated": "Wed Jul 19 2023 07:05:23 GMT+0100 (West Africa Standard Time)",
|
|||
|
"date_updated_code": 1689746723552,
|
|||
|
"date_updated_timestamp": "2023-07-19T06:05:23.000Z"
|
|||
|
}
|
|||
|
]
|