1.0.0 • Published 7 years ago
airtable-db v1.0.0
airtable-db
The domain layer for Airtable
Usage
// src/domain.js
import { AirtableDomain } from '@lambdaschool/airtable-db';
import logger from './logger'
export default new AirtableDomain({ logging: (msg, context) => logger.debug(msg, context) });// application-file.js
import domain from './domain'
function doAirtableStuff() {
const { projectManagerRoles, sections, students } = domain.repositories;
const [
studentRecords,
projectManagerRoleRecords,
sectionRecords,
] = await Promise.all([
students.selectColumns(['calculatedSprintPassRate', 'currentSection', 'originalSectionsPerCourse', 'sprintRetros']),
projectManagerRoles.selectColumns(['studentRecord', 'projectedGraduationSection']),
sections.selectColumns(['sectionSprint']),
]);
}To dynamically select a repository, you can use domain.findRepository('students').
For a list of all functions, see the individual repositories. The BaseRepository has many generic functions which are present on all repositories. Additionally, a given repository might have targeted functions for special cases.
Development
npm i
npm testDeployment
Because an npm package is generated by this project, the following versioning steps need to be followed to publish the package.
- Verify that all PRs have been merged into the
stagingbranch. - Open up a PR to merge the
stagingbranch into themasterbranch. Typically the PR is named after the version that will be published, for examplev2.1.0. - After reviewing the changes that will be merged into master, determine the appropriate version change,
major,minor, orpatch. - While on the
stagingbranch locally, update theCHANGELOG.mdfile with an entry for the new version you're about to publish. Commit your changes. - While still on the
stagingbranch locally, version the project usingnpm version <semver>where<semver>ismajor,minor, orpatch. For example:npm version patch. git pushyour local staging branch up to origin.- When the PR has been reviewed and merged into master, the package will be published by CI after the tests pass.
1.0.0
7 years ago