Prisma1: Prisma as a standalone library

Created on 1 Sep 2018  路  15Comments  路  Source: prisma/prisma1

Is your feature request related to a problem? Please describe.
Deploying a minimal Prisma setup might be more involved than desired, due to the current (effective) requirement of running it inside Docker.

Describe the solution you'd like
Run Prisma in the same machine or even same process as the application server. For example, when I run a Node GraphQL Server, there could be a npm library that runs in the same Node process. Similarly for Go servers, Python, ... .

Another option is to expose Prisma as a daemon. Running Prisma would be as simple as prismad --config path/to/prisma/config.

Describe alternatives you've considered
Make running Prisma inside Docker significantly easier, provide direct cloud integrations for a Prisma setup, and/or provide more/better documentation for Prisma deployment.

Additional context
We are soon sharing more details on this topic 馃檪

kinfeature rf0-needs-spec

Most helpful comment

+1 get rid of docker:-)

All 15 comments

Is there an update on this?

Any updates? It should just be matter of publishing (or putting documentation of how to get) a jar out of this folder right?

Would also love to see how to get prisma set up without docker on a server :)

+1 get rid of docker:-)

Have any update on this ?
How to deploy as Prisma as jar packages?

+1 Without a Docker 馃憤

I would love this! Any idea if it would work in a lambda express server or would the focus be on an express server that is continuously running?

docker is nice BUT WE WOULD LIKE TO GET RID IT!

Would this also mean getting rid of RabbitMQ?
So adding prisma client as a library to a serverless function would be an ideal use case.
Similar to Postgraphiles schema-only usage.

If prisma runs in the same process its seems like supporting hooks into the query building process would be possible. This could be a very powerful feature. (postgraphile supports it as well)

Remove dependency on Docker, Its an issue for me (and others I imagine) that work mostly in cloud based IDEs - it is difficult to get Docker running in a virtual environment, mostly because docker itself hosts the virtual environment.

I've had more luck using postgraphile

const express = require("express");
const { postgraphile } = require("postgraphile");

const app = express();

const postgresConn = "postgres://username:password@localhost:5432/postgres";

const options = {
    classicIds: true,
    graphqlRoute: "/graphql",
    graphiqlRoute: "/graphiql",
    graphiql: true, //!IS_PRODUCTION,
    enhanceGraphiql: true, //!IS_PRODUCTION
    exportJsonSchemaPath: "./schema.json",
    enableCors: true
    // jwtSecret: "123",
    // jwtPgTypeIdentifier: "discipuli.jwt_token",
    // pgDefaultRole: "anonymous"
};

app.use(postgraphile(process.env.DATABASE_URL || postgresConn, options));

app.listen(process.env.PORT || 3000);

console.log(
    `GraphQL listening on http://localhost:${process.env.PORT || 3000}`,
    "\n",
    `GUI: http://localhost:${process.env.PORT || 3000}${options.graphiqlRoute}`
);

+1 The things is cool. would be way cooler without Docker.

+1 get rid of docker

This is basically implemented in Prisma 2.

Please read more about it here: https://www.prisma.io/blog/announcing-prisma-2-zq1s745db8i5/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  路  52Comments

marktani picture marktani  路  41Comments

mcmar picture mcmar  路  57Comments

marktani picture marktani  路  62Comments

schickling picture schickling  路  36Comments