-
Notifications
You must be signed in to change notification settings - Fork 55
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
import failed - pq argument of AND must be type boolean #6
Comments
I found that a table did not have a primary key - after adding this the result without specifying tables is:
And if I specify a table (which I have checked does not have a Bytes field) I still get the other error:
|
Thanks.. I have removed all the bytea fields so that is no longer an issue. On the other error, it is still showing even without the byea fields and fixed primary keys. This is the DDL of one table that showed the same result with -tables "blogs"
There are triggers to update the timestamps, and also to set the ID from a sequence - not included for clarity but let me know if you want a look. The tables are in the 'public' schema (I tried table name as 'public.blogs' but it made no difference). I am running PostgreSQL 13.4 on Windows Let me know if there is anything else I can do to check / help - the project looks terrific and my schema is large and hand coding for ent would be a massive PITA ! |
Hi again, and sorry for the long reply. SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
CREATE TABLE public.blogs
(
id integer NOT NULL,
title character varying(50),
body text,
created_at timestamp without time zone DEFAULT now(),
updated_at timestamp without time zone DEFAULT now(),
slug character varying(55),
key_words character varying(1000)
); And go the follwoing: // Code generated by entimport, DO NOT EDIT.
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
)
type Blog struct {
ent.Schema
}
func (Blog) Fields() []ent.Field {
return []ent.Field{field.Int32("id"),
field.String("title").Optional(),
field.String("body").Optional(),
field.Time("created_at").Optional(),
field.Time("updated_at").Optional(),
field.String("slug").Optional(),
field.String("key_words").Optional()}
}
func (Blog) Edges() []ent.Edge {
return nil
}
func (Blog) Annotations() []schema.Annotation {
return nil
} Try to update entimport to the latest version and run it again, should work fine now (except for the |
Attempting to import from a postgres 13 database with this command:
go run ariga.io/entimport/cmd/entimport -dialect postgres -dsn "host=localhost port=5432 user=postgres dbname=testdb password=tesdbPass sslmode=disable" -tables "services"
It crashes with the error:
entimport: schema import failed - postgres: querying schema tables: pq: argument of AND must be type boolean, not type information_schema.sql_identifier
If I do not include the -tables param, it crashes with:
schema import failed - entimport: invalid primary key - single part key must be present
The text was updated successfully, but these errors were encountered: