Modern applications are complex. We make the data part easy with the functionality your application needs to evolve and scale.
Stop worrying about managing database infrastructure. In seconds you can have a fully managed and scalable database built on Postgres, the database that's trusted by millions of developers and businesses around the world. Get started with our generous free tier today and scale up or down as needed.
Features include a powerful, lightning-fast full-text search engine (powered by Elasticsearch), support for rich data types, and vector search capabilities. Easily create AI-enabled applications with ChatGPT embedded in your database. Xata automatically replicates all of your data from Postgres to additional data stores, so you don't have to.
// Typings and client automatically up to date
import { getXataClient } from "./xata";
const xata = getXataClient();
// Fuzzy-search with column weights
const { records } = await xata.search.all("next.js", {
tables: [
{
table: "posts",
target: [
{ column: "content", weight: 2 },
{ column: "title", weight: 5 },
],
},
],
fuzziness: 2,
prefix: "phrase",
});
from xata.client import XataClient
xata = XataClient()
records = xata.data().search_branch({
"query": "next.js",
"tables": [
{
"table": "posts",
"target": [
{ "column": "content", "weight": 2 },
{ "column": "title", "weight": 5 },
],
}
],
"fuzziness": 2,
"prefix": "phrase",
})
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/search
{
"query": "next.js",
"tables": [
{
"table": "posts",
"target": [
{ "column": "content", "weight": 2 },
{ "column": "title", "weight": 5 },
],
}
],
"fuzziness": 2,
"prefix": "phrase",
}
// Typings and client automatically up to date
import { getXataClient } from "./xata";
const xata = getXataClient();
// Use the ask function to query ChatGPT with your data
const result = await xata.db.Tutorial.ask("How do I retrieve a single record?", {
rules: [
"Do not answer questions about pricing or the free tier. Respond that Xata has several options available, please check https://xata.io/pricing for more information.",
"When you give an example, this example must exist exactly in the context given.",
],
searchType: "keyword",
search: {
boosters: [
{
valueBooster: {
column: "section",
value: "guide",
factor: 18
}
}
]
}
from xata.client import XataClient
xata = XataClient()
result = xata.data().ask(
"Tutorial",
"How do I retrieve a single record?",
rules = [
"Do not answer questions about pricing or the free tier. Respond that Xata has several options available, please check https://xata.io/pricing for more information.",
"When you give an example, this example must exist exactly in the context given.",
],
options = {
"searchType": "keyword",
"search": {
"boosters": [
{
"valueBooster": {
"column": "section",
"value": "guide",
"factor": 18
}
}
]
}
}
}
)
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/tables/{table}/ask
{
"question": "How do I retrieve a single record?",
"rules": [
"Do not answer questions about pricing or the free tier. Respond that Xata has several options available, please check https://xata.io/pricing for more information.",
"When you give an example, this example must exist exactly in the context given.",
],
"searchType": "keyword",
"search": {
"boosters": [
{
"valueBooster": {
"column": "section",
"value": "guide",
"factor": 18
}
}
]
}
}
// Typings and client automatically up to date
import { getXataClient } from "./xata";
const xata = getXataClient();
// Find nearest neighbors of the given vector embedding
const results = await xata.db.docs.vectorSearch(
"embeddings",
[0.1, 0.2, 0.3],
{ size: 5 }
);
from xata.client import XataClient
xata = XataClient()
resp = xata.data().vector_search("docs", {
"queryVector": [0.1, 0.2, 0.3],
"column": "embeddings",
"size": 5
})
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/tables/{table}/vectorSearch
{
"queryVector": [0.1, 0.2, 0.3],
"column": "embeddings",
"size": 5
}
// Typings and client automatically up to date
import { getXataClient } from "./xata";
const xata = getXataClient();
// Run multiple pre-defined transactions
const result = await xata.transactions.run([
{ insert: { table: 'titles', record: { originalTitle: 'A new film' } } },
{ insert: { table: 'titles', record: { id: 'new-0', originalTitle: 'The squeel' }, createOnly: true } },
{ update: { table: 'titles', id: 'new-0', fields: { originalTitle: 'The sequel' }, ifVersion: 0 } },
{ update: { table: 'titles', id: 'new-1', fields: { originalTitle: 'The third' }, upsert: true } },
{ get: { table: "titles", id: "new-0", columns: ['id', 'originalTitle']}},
{ delete: { table: 'titles', id: 'new-0' } }
]);
from xata.client import XataClient
xata = XataClient()
result = xata.data().transaction({
"operations": [
{ "insert": { "table": "titles", "record": { "originalTitle": "A new film" } } },
{ "insert": { "table": "titles", "record": { "id": "new-0", "originalTitle": "The squeel" }, "createOnly": true } },
{ "update": { "table": "titles", "id": "new-0", "fields": { "originalTitle": "The sequel" }, "ifVersion": 0 } },
{ "update": { "table": "titles", "id": "new-1", "fields": { "originalTitle": "The third" }, "upsert": true } },
{ "get": { "table": "titles", "id": "new-0", "columns": ["id", "originalTitle"] } },
{ "delete": { "table": "titles", "id": "new-0" } }
]
})
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/transaction
{
"operations": [
{ "insert": { "table": "titles", "record": { "originalTitle": "A new film" } } },
{ "insert": { "table": "titles", "record": { "id": "new-0", "originalTitle": "The squeel" }, "createOnly": true } },
{ "update": { "table": "titles", "id": "new-0", "fields": { "originalTitle": "The sequel" }, "ifVersion": 0 } },
{ "update": { "table": "titles", "id": "new-1", "fields": { "originalTitle": "The third" }, "upsert": true } },
{ "get": { "table": "titles", "id": "new-0", "columns": ["id", "originalTitle"] } },
{ "delete": { "table": "titles", "id": "new-0" } }
]
}
const record = await xata.db.Users.create({
name: 'Keanu',
photo: {
name: 'file.png',
mediaType: 'image/png',
base64Content:
'iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVR42mNk+M9QzwAEjDAGACCDAv8cI7IoAAAAAElFTkSuQmCC'
}
});
from xata.client import XataClient
xata = XataClient()
record = xata.records().insert("Users", {
"name": "Keanu",
"photo": {
"name": "file.png",
"mediaType": "image/png",
"base64Content": "iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVR42mNk+M9QzwAEjDAGACCDAv8cI7IoAAAAAElFTkSuQmCC",
}
});
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/tables/{table}/data
{
"name": "Keanu",
"photo": {
"name": "file.png",
"mediaType": "image/png",
"base64Content": "iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVR42mNk+M9QzwAEjDAGACCDAv8cI7IoAAAAAElFTkSuQmCC"
}
}
Xata uses the best tools for the job, extending your Postgres database to support more use cases. Here are some popular use cases among our customers.
With a dedicated rich type for embeddings, built-in vector similarity search and a native OpenAI integration, Xata makes it very easy to add AI capabilities to your app.
Learn MoreWhether you write your web app in Python, TypeScript, or JavaScript, you’ll enjoy the best database developer experience. It also comes with built-in support images and attachments.
Learn MoreData from Postgres is automatically replicated to Elasticsearch, the world’s most advanced search engine. The Xata search API makes it very easy to fine tune your app search.
Learn MoreThe Data API, the edge-ready TypeScript SDK, the Vercel, Netlify, and CloudFlare integrations make Xata a pleasure to use together with any serverless platform.
Learn MoreIn seconds, spin up a Postgres database that is ready to scale up (or down) with your workload. With high availability, redundancy and edge caching, the only thing you have to worry about is your application code.
Start freeJoin tens of thousands of developers who are working with Xata to build better products
Guillermo Rauch
@rauchg
Founder & CEO, Vercel
Matt Pocock
@mattpocockuk
TypeScript Educator
Matt Biilmann
@biilmann
CEO, Netlify
Benedicte (Queen) Raae 👑
@raae
Dominus Kelvin
@K.O.O
Web Dev Educator
Neha Narkhede
@nehanarkhede
Co-Founder, Confluent
Zeno Rocha
@zenorocha
Founder & CEO at resend.com
Mohamed Sahel
@mohamedsahel_
Full Stack Developer
Rick Blalock
@rblalock
Dan Cook
@dotxlem
Nakam
@Nakam360
Carlos Alberto Carnero Delgado
@PentiumBug
Xata provides the best free plan in the industry. It is production ready by default and doesn't pause or cool-down. Take your time to build your business and upgrade when you're ready to scale.