Skip to main content

Interacting with your data in Squid

Create powerful queries and perform mutations on any database with the Squid Client SDK.

Squid lets you connect any database and interact with your data using the Squid Client SDK. Whether SQL or NoSQL, you can insert or update data and perform complex queries using the same streamlined methods provided in the SDK. You can even perform joins across database integrations, allowing you to connect completely separate data sources with a few lines of code.

Connecting your database

When you create a Squid app in the Squid Console, a built-in NoSQL database is provided out of the box for both the dev and prod environments. This means you can start developing right away without having to connect any data source.

To connect an existing data source to your Squid app, select the Integrations tab in the Squid Console, click Available Integrations, select the database type from the list, and then provide the database details. Each database type requires a different set of details depending on the requirements of that product. To view instructions for connecting your database, view the database integrations documentation.

Working with data

Concepts

The Squid Client SDK interacts with your data through a structure of collections and documents. A collection can be thought of as a table in a SQL database, or a collection of documents in a NoSQL database. A document can be thought of as a row in a table for a SQL database, or a document in a NoSQL database. No matter the data source, you interact with your data using this same structure.

Client code
// A reference to a collection in a database
const collectionRef = squid.collection<User>('users', 'INTEGRATION_ID');

// A reference to a specific document in the collection
const docRef = collectionRef.doc({ id: 'my_custom_id' });

To learn the foundations of working with data in Squid, check out the following guides:

Querying data

The Client SDK simplifies querying individual or multiple documents.. You can also set up data streaming to keep your query results up-to-date in real-time.

To learn about building queries in Squid, view the following guides:

Modifying data

Inserting, updating, and deleting documents is simple using the Client SDK. Follow these guides to find out how to mutate your data:

Query with AI

Squid provides the capability to query any database through natural language using Query with AI. When you provide a prompt to Query with AI, Squid performs the appropriate query for you and provides the results. You can also use Query with AI to generate charts and graphs of your data, providing insights on the fly without the need to write complex data queries.

You can access Query with AI in the Squid Console or programmatically using the Squid SDK.

Query with AI in the console

To learn more, view the Query with AI documentation.

Explore