📣July 19th release is out!Read the release notes
    An astronaut playing some Matryoshka dolls in a workshop

    No record is too deep for the Triplit console

    Triplit console improvements

    The console now has better support for schemas with nested records. For instance, a schema like this:

    export const schema = {
      businesses: {
        schema: S.Schema({
          id: S.Id(),
          name: S.String(),
          address: S.Record({
            street: S.Record({
              number: S.String(),
              name: S.String(),
            }),
            city: S.String(),
            state: S.String(),
          }),
        }),
      },
    };
    

    Now unrolls all leaf attributes as individual columns in the console.

    The Triplit console displaying a collection with nested records

    Support for expo-sqlite

    Due to popular demand we’ve added storage providers for expo-sqlite. Users of Expo 51 or greater can get started by importing the storage provider from @triplit/db/storage/expo-sqlite:

    import { ExpoSQLiteStorage } from '@triplit/db/storage/expo-sqlite';
    import { TriplitClient } from '@triplit/client';
    
    new TriplitClient({
      storage: {
        cache: new ExpoSQLiteStorage('cache.db'),
        outbox: new ExpoSQLiteStorage('outbox.db'),
      },
    });
    

    You may also instantiate the storage provider with an existing database instance:

    import { ExpoSQLiteStorage } from '@triplit/db/storage/expo-sqlite';
    import * as SQLite from 'expo-sqlite';
    import { TriplitClient } from '@triplit/client';
    
    const cacheDB = SQLite.openDatabaseSync('cache.db');
    const outboxDB = SQLite.openDatabaseSync('outbox.db');
    
    new TriplitClient({
      storage: {
        cache: new ExpoSQLiteStorage(cacheDB),
        outbox: new ExpoSQLiteStorage(outboxDB),
      },
    });
    

    Users of Expo 50 or below can use the storage provider exported by @triplit/db/storage/expo-sqlite-legacy.

    As well if there is a SQLite library that we don't yet have a storage provider for, you can create your own by implementing the SQLiteAdapter interface and providing that to AdapterSQLiteStorage available in @triplit/db/storage/adapter-sqlite. Here is a gist implementing an adapter for op-sqlite, another SQLite library for React Native.

    Saving schema changes

    You've always been able to update your schema in the Triplit console and pull the changes into your local app directory. As of the last month, we've deprecated our previous migration system in favor of something better, and safer: triplit schema push. However, we hadn't added back the ability to save schema changes in the console. Now you can do that again.

    triplit schema print > triplit/schema.ts
    

    Will print out the schema that exists on the server (which the console mirrors) and overwrite the local schema file. Check out the docs on the triplit schema family of commands for more info.

    CLI installs gets faster

    We've removed some large dependencies from the CLI, which should make the installation process faster.

    Landing page improvements on mobile

    We got some feedback that the landing page and this very blog wasn't as mobile-friendly as we'd like. We've made some changes to improve the experience on smaller screens. You might also notice that we've got a new interstellar visitor in the NAV bar.