@altipla/directus-drizzle
TypeScript icon, indicating that this package has built-in type declarations

0.2.10 • Public • Published

directus-drizzle

Generate Drizzle schema & seed function from a Directus instance.

Install

npm i -D @altipla/directus-drizzle

Usage

  1. Add a new download command in your package.json file to pull changes:

    {
      "scripts": {
        "db:pull": "directus-drizzle"
      }
    }
  2. Write a secret static token obtained from your user in Directus in your local .env variables:

    DIRECTUS_TOKEN=XYZ_TOKEN
  3. Configure the rest of settings like the remote URL in the config file. By default it's located in drizzle/directus.config.ts:

    import { defineConfig } from '@altipla/directus-drizzle'
    
    export default defineConfig({
      instance: 'https://www.foo.com',
      seed: {
        collections: ['prefix_*'],
      },
    })
  4. Finally run the command every time you want to regenerate the schema file:

    npm run db:pull

Readme

Keywords

none

Package Sidebar

Install

npm i @altipla/directus-drizzle

Weekly Downloads

4

Version

0.2.10

License

UNLICENSED

Unpacked Size

14.3 kB

Total Files

4

Last publish

Collaborators

  • ernestoalejo