Skip to content

ThinkAM/typeairtable

Repository files navigation

TypeAirtable is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8). Its goal is to always support the latest JavaScript features and provide additional features that help you to develop any kind of application that uses airtable database - from small applications with a few tables to large scale enterprise applications with multiple airtable databases.

TypeAirtable is highly influenced by other ORMs, such as TypeORM and Entity Framework.

Features

  • Entities and columns.
  • Database-specific column types.
  • Repositories and custom repositories.
  • Using multiple database instances.
  • Elegant-syntax and flexible.
  • Supports Airtable.
  • Works in NodeJS / Browser / Ionic / Cordova / React Native / NativeScript / Expo / Electron platforms / ReactJS / Angular / VueJS.
  • TypeScript and JavaScript support.
  • ESM and CommonJS support.
  • Produced code is performant, flexible, clean and maintainable.
  • Follows all possible best practices.

And more...

With TypeAirtable your find look like this:

import { AirTableConfig } from '@thinkam/typeairtable';

const config = new AirTableConfig();

const instance = config.configure({
  baseUrl: 'https://api.airtable.com/v0/your_url',
  apiKey: 'your_api_key',
});

const repository = instance.getRepository({
  tableName: 'your_table',
  columns: {
    name: 'singleText',
    isActived: 'checkBox',
  },
});

const result = await repository.find({
  select: ['name'],
  where: { name: 'blah' },
});

And your create looks like this:

await repository.create({
  name: 'your_name',
  isActived: true,
});

If you prefer update, you can use it as well:

await repository.update('your_id', {
  name: 'other_name',
  isActived: false,
});

And your delete will look this way:

await repository.destroy('your_id');

Installation

  1. Install the npm package:

    npm install @thinkam/typeairtable --save

Contributing

Learn about contribution here and how to setup your development environment here.

About

Airtable for TypeScript and JavaScript (ES7, ES6, ES5). Supports Airtable database. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published