Migrating from Airtable
Airtable is a cloud service: the base, its views and its records live on
Airtable, and the most you can put in your own app is a read-only iframe.
SvGrid Base is the same kind of table database shipped
as a Svelte 5 component. The records move into your own database, <SvBase>
renders the views inside your app, and every edit goes back to your tables.
Estimated effort: half a day for a typical base, plus the time to rebuild its automations.
Facts, checked 14 Oct 2026.
@svgrid/grid3.0.3, MIT, last published 11 Sep 2026, 16,900 npm downloads in the 30 days to 10 Sep 2026. Airtable pricing, as its site states it: Airtable Free has no cost. airtable.com/pricing lists Team at $20 per seat per month billed annually ($24 monthly) and Business at $45 per seat per month billed annually ($54 monthly); Enterprise Scale pricing is custom. Read-only collaborators are not charged on Team or Business (https://airtable.com/pricing, read 14 Oct 2026). SvGrid: SvGrid Base ships in Enterprise Suite of @svgrid/enterprise, $999 per developer per year, unlimited apps and end users; the grid it runs on is MIT. Side by side, with sources: SvGrid vs Airtable.
What maps to what
| Airtable | SvGrid Base |
|---|---|
| A base | A <SvBase tables> with one tab per table |
| A table | A table in your database, opened as a BaseTable |
| A linked record field | A foreign key (link to one) or a junction table (link to many) |
| A view | A FieldView: grid, kanban, calendar, gallery, chart or form |
| An automation | An automation in the view bar, or createAutomationServer on your server |
| Collaborators and permissions | Your app's login, and authorize on the endpoint |
| Comments | setRecordComments, stored where your app stores them |
| An interface | Your own Svelte page around the base |
Field types carry over almost one to one:
| Airtable field | fieldType |
|---|---|
| Single line text | text |
| Long text | longText (with richText for bold, italic, links and lists) |
| Attachment | attachment |
| Checkbox | checkbox |
| Single select, multiple select | singleSelect, multiSelect |
| User | user |
| Date | date |
| Phone number, email, URL | phone, email, url |
| Number, currency, percent | number with format: 'integer', 'currency' or 'percent' |
| Duration | duration |
| Rating | rating |
| Formula | formula |
| Lookup, rollup, count | lookup, rollup, count |
| Created time, last modified time | createdTime, lastModifiedTime |
| Created by, last modified by | createdBy, lastModifiedBy |
| Autonumber | autoNumber |
| Barcode, button | barcode, button |
| Linked record | link |
| AI text | ai (the prompt carries over; your app supplies the model) |
Formulas use the same shape: fields by name in braces, & to join text,
and the same functions; Formula functions lists each
one. Paste each formula into the field editor, or let baseFromAirtable
carry them over; one that uses a function the base does not have shows
#ERROR and names it, and you rewrite that part.
Open an Airtable base from its API
baseFromAirtable turns what Airtable's Web API returns into the tables
<SvBase> takes. Give it the schema (GET /v0/meta/bases/{baseId}/tables)
and, if you want the records too, each table's records (GET /v0/{baseId}/{tableId}), keyed by table id or name. A personal access
token with schema.bases:read and data.records:read reads both.
// scripts/airtable-to-base.ts: run once with Node 18 or later
import { writeFileSync } from 'node:fs'
import { baseFromAirtable, type AirtableRecord, type AirtableRecords } from '@svgrid/enterprise/base'
const BASE = 'appXXXXXXXXXXXXXX'
const headers = { Authorization: `Bearer ${process.env.AIRTABLE_TOKEN}` }
const get = async (path: string) => (await fetch(`https://api.airtable.com/v0/${path}`, { headers })).json()
const schema = await get(`meta/bases/${BASE}/tables`)
const records: AirtableRecords = {}
for (const table of schema.tables) {
const all: AirtableRecord[] = []
let offset = ''
do {
const page = await get(`${BASE}/${table.id}?pageSize=100${offset ? `&offset=${offset}` : ''}`)
all.push(...page.records)
offset = page.offset ?? ''
} while (offset)
records[table.id] = all
}
const { tables, users, report } = baseFromAirtable(schema, records)
for (const r of report) console.log(`${r.table} / ${r.name}: ${r.message}`)
writeFileSync('src/lib/airtable-base.json', JSON.stringify({ tables, users }, null, 2))
<script lang="ts">
import { SvBase, enableBase, setFieldUsers, type BaseTable } from '@svgrid/enterprise/base'
import base from '$lib/airtable-base.json'
enableBase()
setFieldUsers(base.users)
let tables = $state.raw(base.tables as BaseTable[])
</script>
<SvBase bind:tables editable sortable columnAdder fieldMenu />
What it does:
- Every field type in the table above becomes its Base type, with its options: select choices keep their colors, numbers their precision and currency symbol, dates their format, ratings their icon and maximum.
- Each field gets a row key made from its name (
Due dateisdue_date). Table, record and view ids stay Airtable's, so a link field's record ids still point at the right records, and each link names the field that links back in the other table. - A formula's
{fldXXX}references become{Field name}, and its result type sets how the cell shows a number, an amount, a percent or a date.CREATED_TIME(),LAST_MODIFIED_TIME()andLAST_MODIFIED_TIME({Field})read a Created time or Last modified time field. The import uses the table's own when it has a fitting one and adds one when it has not (a Last modified time field that watches the named fields, for the last form), and the report lists what it added. An added Created time field holds each record'screatedTime; an added Last modified time field is empty until the next edit, since the API does not return those times. - Collaborators become user ids (the Airtable
usrXXXid, or what youruserIdoption returns), anduserslists them forsetFieldUsers. Attachments keep their URL, name, type, size and thumbnail. - An AI text field becomes an AI field with
the same prompt, its field ids written as
{Field name}. The generated values come over as stored text; new ones come from the provider your app registers withsetAIProvider. - Grid, Kanban, calendar, gallery and form views carry over, and a timeline becomes a Gantt view.
report lists what did not carry over as it was, one entry per field or
view, with a kind:
kind |
Means |
|---|---|
field |
A field type Base does not have (a sync source). It arrives as a text field with each value as text. |
formula |
A formula calls a function Base does not have, or does not compile. Its cells show #ERROR until you rewrite that part. |
view |
A view type Base does not have (a list, an interface page), or a Kanban or calendar the table has no field for. It is left out. |
link |
A link to a table you left out with the tables option. |
setting |
Something the schema does not say, which the import chose: the field a board stacks by, the dates a calendar uses, a rollup's aggregation, what a button opens, and that an AI field generates new values with the AI provider your app sets. |
The schema has no rollup aggregation: a rollup with a number result is a
SUM and the rest an ARRAYJOIN until you change it in the field editor.
The tables live in the page until you store them; baseToSql(tables)
writes the SQL that creates them, with their records, in Postgres, and
step 3 opens that database as a base.
Formula functions
Every function in Airtable's formula field reference, and what a Base
formula does with it. The table is checked against FORMULA_FUNCTIONS
by a test, so it says what the formula language in this release does.
Try any of them in a formula field below; the second tab is this table.
Text
| Function | SvGrid Base | Notes |
|---|---|---|
CONCATENATE |
Supported | |
LEFT |
Supported | |
RIGHT |
Supported | |
MID |
Supported | The count may be left out for the rest of the text. |
LEN |
Supported | |
FIND |
Supported | Case matters; 0 when the text is not there. |
SEARCH |
Supported | Case matters; empty when the text is not there. |
SUBSTITUTE |
Supported | |
REPLACE |
Supported | |
TRIM |
Supported | |
UPPER |
Supported | |
LOWER |
Supported | |
REPT |
Supported with a difference | At most 1,000 repeats. |
T |
Supported | |
ENCODE_URL_COMPONENT |
Supported | |
REGEX_MATCH |
Supported with a difference | JavaScript regular expressions, not RE2. A leading (?i) works; other inline flags do not. |
REGEX_EXTRACT |
Supported with a difference | JavaScript regular expressions, not RE2. Empty when nothing matches. |
REGEX_REPLACE |
Supported with a difference | JavaScript regular expressions, not RE2. Replaces every match; the new text names a group by its number after a dollar sign, as JavaScript's replace does. |
Logical
| Function | SvGrid Base | Notes |
|---|---|---|
IF |
Supported | |
SWITCH |
Supported with a difference | Compares as text, so 1 matches "1". |
AND |
Supported | |
OR |
Supported | |
NOT |
Supported | |
XOR |
Supported | |
TRUE |
Supported | With or without the parentheses. |
FALSE |
Supported | With or without the parentheses. |
BLANK |
Supported | |
ERROR |
Supported | The cell shows #ERROR. |
ISERROR |
Supported with a difference | Division by zero is empty in Base, not an error, so ISERROR(1 / 0) is false. |
Numeric
| Function | SvGrid Base | Notes |
|---|---|---|
ABS |
Supported | |
AVERAGE |
Supported | |
CEILING |
Supported | |
COUNT |
Supported | |
COUNTA |
Supported | |
COUNTALL |
Supported | |
EVEN |
Supported | |
EXP |
Supported | |
FLOOR |
Supported | |
INT |
Supported | |
LOG |
Supported | Base 10 unless a base is given. |
MAX |
Supported | |
MIN |
Supported | |
MOD |
Supported | |
ODD |
Supported | |
POWER |
Supported | |
ROUND |
Supported | Halves round toward positive: ROUND(-2.5) is -2. |
ROUNDDOWN |
Supported | Toward zero. |
ROUNDUP |
Supported | Away from zero. |
SQRT |
Supported | |
SUM |
Supported | |
VALUE |
Supported | Skips characters that are not part of a number: VALUE("1,200.50 USD") is 1200.5. |
Date
| Function | SvGrid Base | Notes |
|---|---|---|
DATEADD |
Supported with a difference | The units Airtable names, except that "M" is minutes here: write "months". |
DATESTR |
Supported | |
DATETIME_DIFF |
Supported with a difference | Units as in DATEADD: "M" is minutes, write "months". |
DATETIME_FORMAT |
Supported with a difference | moment.js tokens (YYYY, MMMM, Do, HH, A, Z, L, LL and the rest); week-of-year tokens are not read. |
DATETIME_PARSE |
Supported with a difference | Reads the tokens DATETIME_FORMAT writes, with the separators as written. Text without a zone is local time. |
DAY |
Supported | |
HOUR |
Supported | |
IS_AFTER |
Supported | |
IS_BEFORE |
Supported | |
IS_SAME |
Supported | |
MINUTE |
Supported | |
MONTH |
Supported | |
NOW |
Supported | |
SECOND |
Supported | |
SET_LOCALE |
Supported with a difference | Changes the month and weekday names DATETIME_FORMAT writes; ordinals (Do) stay English. |
SET_TIMEZONE |
Supported with a difference | Changes what DATETIME_FORMAT writes. An unknown zone leaves the cell empty. |
TIMESTR |
Supported | |
TONOW |
Supported with a difference | Calendar days from the date to today, signed. |
FROMNOW |
Supported with a difference | Calendar days from today to the date, signed. |
TODAY |
Supported | |
WEEKDAY |
Supported | 0 for Sunday; "Monday" as the second argument makes Monday 0. |
WEEKNUM |
Supported | Weeks start on Sunday, or on Monday with "Monday". |
WORKDAY |
Supported | Holidays as text ("2026-12-25, 2026-12-26") or a list of dates. |
WORKDAY_DIFF |
Supported | Both days count. Holidays as in WORKDAY. |
YEAR |
Supported |
Array
| Function | SvGrid Base | Notes |
|---|---|---|
ARRAYCOMPACT |
Supported | |
ARRAYFLATTEN |
Supported | |
ARRAYJOIN |
Supported | |
ARRAYUNIQUE |
Supported | |
ARRAYSLICE |
Supported |
Record
| Function | SvGrid Base | Notes |
|---|---|---|
RECORD_ID |
Supported | The record's id; after baseFromAirtable, the Airtable record id. |
CREATED_TIME |
Not supported | A Base record keeps that time in a Created time field. baseFromAirtable rewrites CREATED_TIME() to read the table's, and adds one when the table has none. |
LAST_MODIFIED_TIME |
Not supported | A Base record keeps that time in a Last modified time field. baseFromAirtable rewrites LAST_MODIFIED_TIME() to read one that watches every field, and LAST_MODIFIED_TIME({Field}) one that watches that field, and adds it when the table has none. |
1. Export each table
In Airtable, open a grid view that shows every field and every record (no filter, no hidden fields) and choose Download CSV. Do this for each table. A linked record column comes out as text naming the linked records rather than as record ids; open one file to see the exact form before the next step turns those names back into links.
Attachment columns come out as URLs that Airtable expires after a few hours. Download the files straight away and put them in your own storage, or skip the column and move the files later.
2. Load the tables into your database
Create a table per Airtable table, with a key the database makes, and load the CSV with a text column for each link. Postgres:
create table projects (
id uuid primary key default gen_random_uuid(),
name text not null,
status text,
due date
);
create table tasks (
id uuid primary key default gen_random_uuid(),
task text not null,
status text,
budget numeric,
project_name text, -- the CSV's "Project" column
project_id uuid references projects(id)
);
\copy projects (name, status, due) from 'Projects-Grid view.csv' csv header
\copy tasks (task, status, budget, project_name) from 'Tasks-Grid view.csv' csv header
Then match the names to keys and drop the text column:
update tasks t set project_id = p.id
from projects p where p.name = t.project_name;
alter table tasks drop column project_name;
A link to many records becomes a table that pairs the two. Load the CSV's
list of names into a text column first (tag_names below; adjust the
separator to what the file holds), then:
create table task_tags (
task_id uuid references tasks(id) on delete cascade,
tag_id uuid references tags(id) on delete cascade,
primary key (task_id, tag_id)
);
insert into task_tags (task_id, tag_id)
select t.id, g.id
from tasks t
cross join lateral unnest(string_to_array(t.tag_names, ', ')) as n(name)
join tags g on g.name = n.name;
Names must be unique for the match to be right. If two Airtable records shared a primary value, give them distinct names before you export, or match on another column.
3. Open the database as a base
One endpoint on your server reads the tables and serves them; the page opens them. A foreign key becomes a link with a field in the other table that links back, a pairing table a link to many records, and a text column that repeats a few values a single select with a color per value (what it reads).
// src/routes/api/base/+server.ts
import { createBaseEndpoint } from '@svgrid/enterprise/base'
// Your database driver: run parameterized SQL, return the rows.
declare function query(sql: string, params: unknown[]): Promise<Record<string, unknown>[]>
export const { GET, POST } = createBaseEndpoint({ execute: query })
<!-- src/routes/base/+page.svelte (with `export const ssr = false` in +page.ts) -->
<script lang="ts">
import { SvToaster } from '@svgrid/grid'
import { SvBase, baseFromEndpoint, enableBase } from '@svgrid/enterprise/base'
enableBase()
const tables = baseFromEndpoint('/api/base')
</script>
{#await tables then tables}
<SvBase {tables} editable sortable columnAdder fieldMenu />
{/await}
<SvToaster />
Build a base on Postgres is the same thing end to end, and From a database to an app covers MySQL, SQLite and Supabase.
4. Set the field types and views
The base guesses the types from the columns. Fix the ones it cannot know (a percent, a rating, a user, a formula) and recreate the views you used:
import type { FieldView } from '@svgrid/enterprise/base'
const views: FieldView[] = [
{ id: 'all', name: 'All tasks', type: 'grid', color: { mode: 'field', field: 'status' } },
{ id: 'board', name: 'Board', type: 'kanban', stackBy: 'status' },
{ id: 'due', name: 'Due dates', type: 'calendar', dateField: 'due' },
{ id: 'request', name: 'Request a task', type: 'form' },
]
What you change in the app (field types, views, colors) comes back through
onTablesChange; store it and start from it next time. The records stay in
your database either way.
5. Rebuild the automations
Open Automations in the view bar. The triggers you know are there: a
record is created, a record changes, a record matches a condition, a form
is sent, a button is pressed, a scheduled time. The actions update the
record, create a record in any table, show a notice, color the record,
call a webhook or send an email. An Airtable script that calls an API
becomes a webhook action, or an action you register in code with
registerAutomationAction.
Automations that must run whoever made the change, or that hold secrets,
run on your server with createAutomationServer; see
Automations on the server.
6. Users, permissions and comments
Your app's login replaces Airtable collaborators. List the people for user
fields with setFieldUsers, say who is signed in with setCurrentUser
(created by and last modified by read it), and decide who may read or write
what in the endpoint's authorize, or with row level security on Supabase.
Comments go through setRecordComments to wherever you keep them.
What you give up
- The hosted service: someone adds
<SvBase>to a Svelte app and runs the database it reads. - Interfaces, Omni and the AI credits. The pages around the base are your own Svelte pages.
- Native mobile apps, and the list and inbox views.
- The permissions screen, sharing links and the long revision history.
Access rules live in your server or database; the record shows the
changes made in the session, and the endpoint's
audithook can log every write.
SvGrid Base is part of the Suite edition of @svgrid/enterprise ($999 per
developer). It runs without a key during an evaluation, with a watermark.
See also
- SvGrid vs Airtable: the side-by-side comparison with sources.
- Build a project tracker: SvGrid Base step by step.
- Ready-to-use bases: a CRM, a content calendar, a roadmap and more.
- Field types: every type and its properties.
Live examples
- Move a base in from its API export - Paste the schema and records a hosted table-database service's Web API returns and open them as a base: two linked tables, selects with their colors, people matched by email, a rollup, a lookup and formulas whose field-id references become field names. The report beside it lists what did not carry over as it was.
- Formula compatibility - A formula playground over an orders table: pick an example or type a formula and the Result column recomputes as you type; one that does not compile says why. The second tab lists every function of the common table-database formula language with its status in SvGrid Base, read from the formula engine itself.
Related articles
- Migrating a Svelte 4 Table Component to Svelte 5 - A concept-by-concept guide to porting a hand-rolled Svelte 4 data table to Svelte 5 runes - props, reactivity, stores, slots, events, and when to stop hand-rolling entirely.
- Migrating from DataTables.net to a Svelte Data Grid - A practical migration guide from jQuery DataTables to SvGrid - how column definitions, server-side data, custom rendering, and selection map across, with working code for each step.
- Migrating from ag-grid-react to a Svelte Stack - A practical field guide for porting ag-grid-react screens to SvGrid - column defs, cell renderers, server-side data, and the React-to-Svelte reactivity shift.