Comments (6)
The CLI takes the flags and converts them into library-mode equivalents, e.g. here's where it takes the connection
CLI flag and adds it to the configuration for library mode:
crystal/postgraphile/postgraphile/src/cli.ts
Lines 204 to 212 in 6124725
Please can you show a reproduction of your issue?
from crystal.
Sorry, actually it's due the -c
option not really related to the library mode.
file : .env
DATABASE_URL=postgres://dev:dev@locahost:5430/flashdb
file : graphile.config.js
import { PostGraphileAmberPreset } from "postgraphile/presets/amber";
import { PgSimplifyInflectionPreset } from "@graphile/simplify-inflection";
import { makePgService } from "postgraphile/adaptors/pg";
import dotenv from "dotenv";
dotenv.config({ path: ".env" });
const preset = {
extends: [PostGraphileAmberPreset, PgSimplifyInflectionPreset],
schema: {
pgJwtSecret: process.env.JWT_SECRET,
},
gather: {
pgJwtTypes: "jwt_token",
},
pgServices: [
makePgService({
connectionString: process.env.DATABASE_URL,
pubsub: true,
}),
],
grafserv: { watch: true },
};
export default preset;
when running postgraphile
it doesn't work (error : postgres says: Error: getaddrinfo ENOTFOUND locahost
)
when running postgraphile -c 'postgres://dev:dev@localhost:5430/flashdb'
it works fine
If edit .env file with :
DATABASE_URL=postgres://dev:[email protected]:5430/flashdb
both work fine
from crystal.
You’ve misspelt localhost
as locahost
.
from crystal.
Oh yeah sorry, It was a mistake while trying to reproduce, but still after fixing it DATABASE_URL=postgres://dev:dev@localhost:5430/flashdb
bun postgraphile
command works
but
bun server.ts
doesn't work
both work well with 127.0.0.1
here is my server.ts
import Fastify from "fastify";
import { grafserv } from "grafserv/fastify/v4";
import preset from "./graphile.config.js";
import { postgraphile } from "postgraphile";
const pgl = postgraphile(preset);
const server = pgl.createServ(grafserv);
const app = Fastify({ logger: true });
server.addTo(app).catch((e) => {
console.error(e);
process.exit(1);
});
app.listen({ port: preset.grafserv?.port ?? 5678 }, (err, address) => {
if (err) throw err;
console.log(`Server is now listening on ${address}`);
});
from crystal.
Btw I understood the real cause, it works well with localhost
using tsx server.ts
but doesn't with bun
, for some reason I had to use 127.0.0.1
instead for bun to work.
from crystal.
Please in future mention you’re using bun up front, this probably goes for filing an issue against any Node.js module that you’re having issues with under bun or any alternative runtime. Glad you figured it out.
from crystal.
Related Issues (20)
- Document the new "early exit" and "global dependencies" features
- Epic: removing $step.eval()
- Masked errors when output to console should include path, etc.
- `makeWrapPlansAfterArgumentsHaveBeenAppliedPlugin` - solve confusion
- PostGraphileRelayPreset bug: mutation with "null" foreign key value does not work (returns null) HOT 1
- How does Postgraphile integrate with Apache AGE? HOT 1
- Polymorphism - union containing members of an interface plus another; how to plan?
- Create tests for middleware system (grafast, grafserv)
- multi tenancy and update pg schema without restart HOT 1
- Koa middleware does not call next() for all scenarios HOT 7
- (v5) I'd like get a generic executor from `build.input.pgRegistry` inside a `makeExtendSchemaPlugin`. HOT 1
- Questions based on initial experience with v5 polymorphism HOT 6
- The v5 documentation for crud mutations mentions both `insert` and `create` as values for the `@behavior` smart tag. HOT 2
- PgExecutor cache is not cleared between subscription payloads
- Subscription error causes socket to disconnect
- `PostGraphileRelayPreset` does not eliminate `Row` in `ByRowId`
- Polymorphic types offer mutations under some circumstances? HOT 1
- Derived types include selector for the derived types when using relational polymorphism
- How to call custom function with the id provided by the relay preset HOT 3
- It should be possible to declare a shared `@ref` only in the base table when using relational polymporphism HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crystal.