This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

entity-object-mapper

1.1.1 • Public • Published

Entity-Object-Mapper

Entity-object-mapper is a code generator. Its fetches table and schema defintions from database and generates data access objects from it.

  • Postgres and mysql supported as datasource.
  • Can be extended with EJS templates.

How To Install

npm install entity-object-mapper --save

or

yarn add entity-object-mapper

Usage

Example usages under example folder

const { generateFromDataSource } = require("entity-object-mapper");

const generatedCode = generateFromDataSource({
  databaseOptions: {
    config: {
      database: "db",
      host: "localhost",
      port: 5432,
      user: "user",
      password: "password",
    },
    datasource: "postgres",
  },
  language: "java",
  schema: "schema",
  table: "table",
  templateOptions: {
    templatePath: "/TEMPLATE_DIRECTORY",
    templater: "ejs",
  },
  extras: {
    packageName: "package_name",
  },
});

// or export directly
generateFromDataSourceAndExport(
  {
    databaseOptions: {
      config: {
        database: "db",
        host: "localhost",
        port: 5432,
        user: "user",
        password: "password",
      },
      datasource: "postgres",
    },
    language: "java",
    schema: "schema",
    table: "table",
    templateOptions: {
      templatePath: "/TEMPLATE_DIRECTORY",
      templater: "ejs",
    },
    extras: {
      packageName: "package_name",
    },
  },
  "/EXPORT_DIRECTORY"
);

CLI

You can use cli app with npx.

npx entity-object-mapper

License

Feel free to contribute

MIT © emrecankoc

Package Sidebar

Install

npm i entity-object-mapper

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

22.9 kB

Total Files

17

Last publish

Collaborators

  • emrecankoc