# prisma-generator-elixir

> Generates Elixir Ecto and Absinthe GraphQL files from Prisma Schema

Latest version **0.0.4** (published 2021-12-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install prisma-generator-elixir
pnpm add prisma-generator-elixir
yarn add prisma-generator-elixir
bun add prisma-generator-elixir
```

Provides the command `prisma-generator-elixir`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-12-14 |
| First published | 2021-12-14 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 8 |
| Unpacked size | 27.7 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ron Arts |
| Maintainers | raarts |
| Keywords | prisma, generator, elixir, absinthe, graphql |

## Links

- npm: https://www.npmjs.com/package/prisma-generator-elixir
- Repository: https://github.com/raarts/prisma-generator-elixir
- Homepage: https://github.com/raarts/prisma-generator-elixir#readme
- Issues: https://github.com/raarts/prisma-generator-elixir/issues
- npm.io page: https://npm.io/package/prisma-generator-elixir

## Dependencies (8)

- [tar](https://npm.io/package/tar.md) ^6.1.11
- [case](https://npm.io/package/case.md) ^1.6.3
- [slash](https://npm.io/package/slash.md) ^4.0.0
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [make-dir](https://npm.io/package/make-dir.md) ^3.1.0
- [@prisma/sdk](https://npm.io/package/@prisma/sdk.md) ^3.6.0
- [@prisma/client](https://npm.io/package/@prisma/client.md) ^3.6.0
- [@prisma/generator-helper](https://npm.io/package/@prisma/generator-helper.md) ^3.6.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2021-12-14
- 0.0.3 — 2021-12-14
- 0.0.2 — 2021-12-14
- 0.0.1 — 2021-12-14

## README

# Prisma Generator Elixir 

1. [What is it?](#what-is-it)
1. [Usage](#usage)
1. [Example](#example)
1. [License](#license)

(This is absolutely not ready yet, pre-pre-pre alpha)
## <a name="what-is-it"></a>What is it?

Generates `schema`, `resolvers`,  for models in your Prisma Schema. 

## <a name="usage"></a>Usage

```sh
npm install --save-dev @raarts/prisma-generator-elixir
```

```prisma
generator elixir {
  provider                        = "prisma-generator-elixir"
  output                          = "../hello/lib/hello_web"
  appname                         = "Hallo"
}
```

### Parameters

- [`output`]: (required) - output path relative to your `schema.prisma` file
- [`appname`]: (required) - Base name of the Elixir Application 
- [`genEcto`]: (optional) - Generate Ecto schema. Default true
- [`genTypes`]: (optional) - Generate Absinthe Type files. Default true
- [`genResolvers`]: (optional) - Generate Absinthe Resolvers based on Ecto Repo calls. Default true 
- [`genSchema`]: (optional) - Generate Absinthe Schema file. Default true
- [`genMigration`]: (optional) - Generate Ecto migration file. Default false


## <a name="example"></a>Example

<details>
  <summary>Prisma Schema</summary>
  
  ```prisma

generator elixirAbsinthe {
provider = "prisma-generator-elixir"
output = "../src"
}

model Question {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
/// @DtoReadOnly
createdAt DateTime @default(now())
/// @DtoRelationRequired
createdBy User? @relation("CreatedQuestions", fields: [createdById], references: [id])
createdById String? @db.Uuid
updatedAt DateTime @updatedAt
/// @DtoRelationRequired
updatedBy User? @relation("UpdatedQuestions", fields: [updatedById], references: [id])
updatedById String? @db.Uuid

    /// @DtoRelationRequired
    /// @DtoRelationCanConnectOnCreate
    category   Category? @relation(fields: [categoryId], references: [id])
    categoryId String?   @db.Uuid

    /// @DtoCreateOptional
    /// @DtoRelationCanCreateOnCreate
    /// @DtoRelationCanConnectOnCreate
    /// @DtoRelationCanCreateOnUpdate
    /// @DtoRelationCanConnectOnUpdate
    tags Tag[]

    title     String
    content   String
    responses Response[]

}

````

</details>

<details>
<summary>Generated results</summary>

</details>

## <a name="license"></a>License

All files are released under the [Apache License 2.0](https://github.com/raarts/prisma-generator-elixir/blob/master/LICENSE).

---
_Source: https://npm.io/package/prisma-generator-elixir · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
