@nanodb-orm/plugin-timestamps
v0.1.0
Published
Auto createdAt/updatedAt timestamps for nanodb-orm
Readme
@nanodb-orm/plugin-timestamps
Auto-add createdAt and updatedAt timestamps for nanodb-orm.
Install
npm install @nanodb-orm/plugin-timestampsUsage
import { createDatabase } from 'nanodb-orm';
import { timestamps } from '@nanodb-orm/plugin-timestamps';
const db = await createDatabase({
tables,
plugins: [timestamps()],
});Options
timestamps({
createdAt: 'createdAt',
updatedAt: 'updatedAt',
tables: ['users'],
useUnixTimestamp: false,
});