Overview
Last updated
Last updated
Currently this SDK is intended for usage in either Typescript or Javascript projects. If you are looking to have it made available for another platform or language we'd love to hear more all about that!
You can add the package to your project in the ways.
npm i @outerbase/sdk
Below is a chart that breaks down which features are intended for what platform use cases. All features should work on both the frontend and backend but for best practices and security purposes we find it important to explicitly enumerate them below.
Feature | System |
---|---|
Generating data models helps you map your data exactly as the relationships are declared in your database with the rest of your development stack. This greatly reduces ambiguity, out of sync nomenclature, and removes unnecessary manual redeclaration of classes at each layer of your application.
Since the introspection is only generating Typescript classes, there is no issues with using it on the frontend or the backend to reference those models.
** - We don't advise you using available methods that generate or execute SQL on the frontend, these are meant for backend purposes only. See Query Builder section for more details as to why.
Executing network calls to saved queries within Outerbase allow you to send requests securely without exposing SQL statements to your frontend client, and only allowing a pre-determined set of SQL statements to be executable. Because of those reasons running remote queries is entirely safe on both the frontend and backend side of your development stack.
An added benefit to executing remote queries is the fact that these queries can be cached with a customized TTL (time to live) which can greatly reduce the overhead your database receives for duplicative calls, or long executing queries.
Query Builder generates either a named or positional parameterized raw SQL query, accompanied by the parameters, and can be used to .query()
and trigger a network call to your database. If that event was fired from the frontend platform then users could observe that traffic and potentially send malicious SQL statements to your database causing potentially catastrophic and unintended affects.
If you have any questions, you can reach us at support@outerbase.com
Every space voyage needs a crew. The Outerbase SDK is an open source project that any human being can contribute to. Add your ideas to our Discussions, report your bugs as Issues, or open your first Pull Request to add more functionality for others.
Data Models
Frontend** & Backend
Remote Queries
Frontend & Backend
Query Builder
Backend