1 line
18 KiB
HTML
1 line
18 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="next-head-count" content="2"/><meta name="author" content="Datasquirel"/><meta name="Copyright" content="Copyright (c) 2024 Datasquirel"/><meta name="robots" content="noindex,nofollow"/><link rel="preconnect" crossorigin="anonymous" data-href="https://fonts.googleapis.com/"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><script src="/scripts/themeSelector.js"></script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta property="og:site_name" content="DATASQUIREL"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary"/><meta property="og:image" content="https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"/><meta itemProp="image" content="https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"/><meta name="twitter:image" content="https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"/><link rel="stylesheet" href="/styles/prism.css"/><script src="/scripts/prism.js" async=""></script><script>var DSQL = {}</script><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /><link rel="preload" href="/_next/static/css/6e07698ca37913b7.css" as="style"/><link rel="stylesheet" href="/_next/static/css/6e07698ca37913b7.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-309fbebe2073f18c.js" defer=""></script><script src="/_next/static/chunks/framework-4ed89e9640adfb9e.js" defer=""></script><script src="/_next/static/chunks/main-fd9fe2eccf11c307.js" defer=""></script><script src="/_next/static/chunks/pages/_app-881c4f419bb13dab.js" defer=""></script><script src="/_next/static/chunks/pages/docs/%5Bpage%5D-3602862f9a9542f8.js" defer=""></script><script src="/_next/static/GyARel3iZW77enhsiNoJy/_buildManifest.js" defer=""></script><script src="/_next/static/GyARel3iZW77enhsiNoJy/_ssgManifest.js" defer=""></script><style data-href="https://fonts.googleapis.com/css?family=Poppins">@font-face{font-family:'Poppins';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/poppins/v21/pxiEyp8kv8JHgFVrJJfedA.woff) format('woff')}@font-face{font-family:'Poppins';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/poppins/v21/pxiEyp8kv8JHgFVrJJnecnFHGPezSQ.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Poppins';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/poppins/v21/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}</style><style data-href="https://fonts.googleapis.com/css?family=Inter">@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hjg.woff) format('woff')}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZJhjp-Ek-_EeAmM.woff) format('woff');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZthjp-Ek-_EeAmM.woff) format('woff');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZNhjp-Ek-_EeAmM.woff) format('woff');unicode-range:U+1F00-1FFF}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZxhjp-Ek-_EeAmM.woff) format('woff');unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZBhjp-Ek-_EeAmM.woff) format('woff');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZFhjp-Ek-_EeAmM.woff) format('woff');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Inter';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hjp-Ek-_EeA.woff) format('woff');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}</style><style data-href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono">@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n1i8q0Q.woff) format('woff')}@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n1iIq131nj-otFQ.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n1isq131nj-otFQ.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n1iAq131nj-otFQ.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n1iEq131nj-otFQ.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/ibmplexmono/v19/-F63fjptAgt5VM-kVkqdyU8n1i8q131nj-o.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}</style></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"user":null,"pages":[{"id":8,"title":"Getting Started","slug":"getting-started","level":1,"parent_id":null},{"id":9,"title":"Getting Started","slug":"getting-started","level":2,"parent_id":3},{"id":2,"title":"Quick Start","slug":"quick-start","level":1,"parent_id":null},{"id":3,"title":"GUI Reference","slug":"gui-reference","level":1,"parent_id":null},{"id":4,"title":"API Reference","slug":"api-reference","level":1,"parent_id":null},{"id":10,"title":"Get","slug":"get","level":2,"parent_id":4},{"id":12,"title":"Database Reference","slug":"database-reference","level":1,"parent_id":null},{"id":11,"title":"Post","slug":"post","level":2,"parent_id":4},{"id":13,"title":"Data types","slug":"data-types","level":2,"parent_id":12},{"id":14,"title":"Querying Data","slug":"querying-data","level":2,"parent_id":12},{"id":15,"title":"Upload Media","slug":"upload-media","level":2,"parent_id":3}],"targetPage":{"title":"Quick Start","slug":"quick-start","description":"\u003cp\u003eStart saving and retrieving data now. Set up and start deploying in minutes.\u003c/p\u003e","content":"\u003ch2\u003eStarting up your Datasquirel instance\u003c/h2\u003e\u003cp\u003eTo 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:\u003c/p\u003e\u003ch3\u003e1. Create Account\u003c/h3\u003e\u003cp\u003eCreate a free account \u003ca href=\"https://datasquirel.com/create-account\"\u003ehere\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/create-account.png\" width=\"800\" height=\"578\" /\u003e\u003c/p\u003e\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\u003ch3\u003e2. Create Database\u003c/h3\u003e\u003cp\u003eNavigate to your \u003ca href=\"https://datasquirel.com/admin\"\u003eDashboard\u003c/a\u003e or \u003ca href=\"https://datasquirel.com/admin/databases\"\u003eDatabases page\u003c/a\u003e. Click the \"Add Database\" button to add a new database.\u003c/p\u003e\u003cp\u003e\u003cimg 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\" /\u003e\u003c/p\u003e\u003cp\u003eOn 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\u003c/p\u003e\u003cp\u003e\u003cimg 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\" /\u003e\u003c/p\u003e\u003cp\u003eCreating 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.\u003c/p\u003e\u003cp\u003e\u003cimg 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\" /\u003e\u003c/p\u003e\u003ch3\u003e3. Add a table\u003c/h3\u003e\u003cp\u003eDatabases 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.\u003c/p\u003e\u003cp\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-table-form.png\" width=\"800\" height=\"797\" /\u003e\u003c/p\u003e\u003cp\u003eOn each table form you have access to the table fields(or column titles). Each field contains a few options:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cstrong\u003eField Name\u003c/strong\u003e: Name of field(or column title)\u003c/li\u003e\u003cli\u003e\u003cstrong\u003eData Type\u003c/strong\u003e: type of data to be stored on that field: \u003ca class=\"inline\" href=\"docs/db-reference/data-types\"\u003eSee All Datatypes\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003cstrong\u003eRequired\u003c/strong\u003e: Choose whether the field must have a value or not\u003c/li\u003e\u003cli\u003e\u003cstrong\u003eDefault Value\u003c/strong\u003e: Default value of field in the case no value is entered.\u003c/li\u003e\u003cli\u003e\u003cstrong\u003eMore:\u003c/strong\u003e The \"More\" button contains options for encryption and foreign keys\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eAfter these fields are filled, click \"Add Field\". Add as much field as you need. These fields serve as column titles for your table.\u003c/p\u003e\u003cp\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/tables-list.png\" width=\"800\" height=\"374\" /\u003e\u003c/p\u003e\u003cp\u003eAfter creating a table you now have access to the tables list.\u003c/p\u003e\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\u003ch3\u003e4. Add an Entry\u003c/h3\u003e\u003cp\u003eSelect the newly created Table and on the designated table page click on \"Add New Table Entry\"\u003c/p\u003e\u003cp\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/table-page.png\" width=\"800\" height=\"576\" /\u003e\u003c/p\u003e\u003cp\u003eFill 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.\u003c/p\u003e\u003cp\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-entry.png\" width=\"800\" height=\"633\" /\u003e\u003c/p\u003e\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\u003ch2\u003eFetching Data\u003c/h2\u003e\u003cp\u003eto start fetching data from your datasquirel account, you need to go through 3 steps:\u003c/p\u003e\u003ch3\u003e1. Create an API key\u003c/h3\u003e\u003cp\u003eYour api key is your gateway to all your data. There are two sets of API keys available for use: \u003cstrong\u003eRead Only \u003c/strong\u003eAPI keys, and \u003cstrong\u003eFull Access \u003c/strong\u003eAPI 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.\u003c/p\u003e\u003cp\u003eTo create an API key, follow these steps:\u003c/p\u003e\u003cul\u003e\u003cli\u003eLogin to your admin dashboard and navigate to \"API keys\" page\u003cbr /\u003e\u003cbr /\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/api-keys-page.png\" width=\"700\" height=\"327\" /\u003e\u003c/li\u003e\u003cli\u003eClick 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).\u003cbr /\u003e\u003cbr /\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/add-api-key-dialogue.png\" width=\"700\" height=\"327\" /\u003e\u003c/li\u003e\u003cli\u003eOnce your API key is created, copy the API key by clicking \"Copy API key\". Keep this key safe and secured.\u003cbr /\u003e\u003cbr /\u003e\u003cimg src=\"https://static.datasquirel.com/images/user-images/user-2/docs/api-keys-list.png\" width=\"700\" height=\"327\" /\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e\u003cbr /\u003e\u003c/h3\u003e\u003ch3\u003e2. Use your API key to make a request\u003c/h3\u003e\u003cp\u003eAfter creating your API key, then comes the backend section.\u003c/p\u003e\u003cul\u003e\u003cli\u003eFirst add the datasquirel package via NPM\u003cbr /\u003e\u003cbr /\u003e\u003cpre class=\"language-markup\"\u003enpm install datasquirel\u003c/pre\u003e\u003c/li\u003e\u003cli\u003eNext import the datasquirel module into your project, choose the database you will be querying, add your API key, and then run the query.\u003cbr /\u003e\u003cbr /\u003e\u003cpre class=\"language-javascript\"\u003e\u003cspan class=\"token keyword\"\u003econst\u003c/span\u003e datasquirel \u003cspan class=\"token operator\"\u003e=\u003c/span\u003e \u003cspan class=\"token function\"\u003erequire\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c/span\u003e\u003cspan class=\"token string\"\u003e\"datasquirel\"\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c/span\u003e\n\ndatasquirel\n \u003cspan class=\"token punctuation\"\u003e.\u003c/span\u003e\u003cspan class=\"token function\"\u003eget\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e{\u003c/span\u003e\n \u003cspan class=\"token literal-property property\"\u003edb\u003c/span\u003e\u003cspan class=\"token operator\"\u003e:\u003c/span\u003e \u003cspan class=\"token string\"\u003e\"test\"\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e,\u003c/span\u003e\n \u003cspan class=\"token literal-property property\"\u003ekey\u003c/span\u003e\u003cspan class=\"token operator\"\u003e:\u003c/span\u003e process\u003cspan class=\"token punctuation\"\u003e.\u003c/span\u003eenv\u003cspan class=\"token punctuation\"\u003e.\u003c/span\u003e\u003cspan class=\"token constant\"\u003eDATASQUIREL_READ_ONLY_KEY\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e,\u003c/span\u003e\n \u003cspan class=\"token literal-property property\"\u003equery\u003c/span\u003e\u003cspan class=\"token operator\"\u003e:\u003c/span\u003e \u003cspan class=\"token string\"\u003e\"SELECT title, slug, body FROM blog_posts\"\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e,\u003c/span\u003e\n \u003cspan class=\"token punctuation\"\u003e}\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c/span\u003e\n \u003cspan class=\"token punctuation\"\u003e.\u003c/span\u003e\u003cspan class=\"token function\"\u003ethen\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c/span\u003e\u003cspan class=\"token parameter\"\u003eresponse\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c/span\u003e \u003cspan class=\"token operator\"\u003e=\u0026gt;\u003c/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c/span\u003e\n console\u003cspan class=\"token punctuation\"\u003e.\u003c/span\u003e\u003cspan class=\"token function\"\u003elog\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c/span\u003eresponse\u003cspan class=\"token punctuation\"\u003e)\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c/span\u003e\n \u003cspan class=\"token punctuation\"\u003e}\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eRead our \u003ca href=\"../../../docs/api-reference\"\u003eAPI Reference\u003c/a\u003e for more.\u003c/p\u003e"}},"__N_SSG":true},"page":"/docs/[page]","query":{"page":"quick-start"},"buildId":"GyARel3iZW77enhsiNoJy","isFallback":false,"gsp":true,"scriptLoader":[]}</script></body></html> |