-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to start supergraph via docker-compose which generated using go. #76
Comments
Did you edit the migrations file or the postgres version? |
Hi, Postgres version seems 12, this was created when ran the go command. |
Try creating the app again from scratch. Not sure whats going on here it all seems right. Remember to kill all docker containers first.
|
Hi, Tried it again getting the same error, I have tried it in another machine also. The command you provided 4th one is missing ==== CREATE TABLE public.users ( ERR ERROR: syntax error at or near ";" (SQLSTATE 42601) ==== Are there environment variables to pass the database details on the docker version of the super-graph?. So that we can use super-graph docker version with our postgres database. |
Try deleting all your docker images and trying the commands again the missing command is due to changes in the latest docker image released today. I tried this from scratch and it works perfectly for me the I feel might be some issue with your environment so it's interesting to understand why you're facing this issue. |
Hi, Sorry for saying that it didn't help me, I tried it from scratch but the same error, please see the complete process below, ashar@testing: Postgres DBdb: supersuper_api: CREATE TABLE public.users ( ERR ERROR: syntax error at or near ";" (SQLSTATE 42601) |
I experienced the same error, in my case, the initial autogenerated migration looked like this: -- Write your migrate up statements here
CREATE TABLE public.users (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
full_name text,
email text UNIQUE NOT NULL CHECK (length(email) < 255),
created_at timestamptz NOT NULL NOT NULL DEFAULT NOW(),
updated_at timestamptz NOT NULL NOT NULL DEFAULT NOW()
);
---- create above / drop below ----
-- Write your down migrate statements here. If this migration is irreversible
-- then delete the separator line above.
DROP TABLE public.users Note the HTML entity |
I see the same issue here. "super-graph new app" generates config/seed.js and config/migrations/0_init.sql with HTML entities - "<" instead of "<". I've not dug too deeply, but I'd guess that internal/serv/cmd_new.go should be importing "text/template" rather than "html/template". https://github.com/dosco/super-graph/blob/master/internal/serv/cmd_new.go#L5 I've put that in it's own issue: #95 |
Thanks for reporting this the import must have been switched by the IDE I'll fix this. |
Fixed in a recent commit previous to 9c19db2 |
Hi,
I could able to generate files using the below commands,
go get github.com/dosco/super-graph
super-graph new testapp
After that, I tried to start services using docker-compose file,
ashar@testing:~/testapp$ docker logs -f testapp_testapp_api_1
restarting "./super-graph" when it changes (additional dirs: ./config)
INF roles_query not defined: attribute based access control disabled
ERR failed to initialize Super Graph: error fetching version: failed to connect to
host=db user=postgres database=testapp_development
: server error (FATAL: database "testapp_development" does not exist (SQLSTATE 3D000))Upon searching I could able to see that the below command to fix the issue but getting some query issues also,
ashar@testing:~/testapp$ docker-compose run testapp_api ./super-graph db:setup
Creating network "testapp_default" with the default driver
Creating testapp_db_1 ... done
INF created database 'testapp_development'
INF 2020-06-16 10:15:01 executing 0_init.sql up
-- Write your migrate up statements here
CREATE TABLE public.users (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
full_name text,
email text UNIQUE NOT NULL CHECK (length(email) < 255),
created_at timestamptz NOT NULL NOT NULL DEFAULT NOW(),
updated_at timestamptz NOT NULL NOT NULL DEFAULT NOW()
);
ERR ERROR: syntax error at or near ";" (SQLSTATE 42601)
Please let me know what is wrong.
The text was updated successfully, but these errors were encountered: