yes with diesel_cli https://github.com/diesel-rs/diesel/tree/master/diesel_cli
#Database to rust structs [DIESEL]
8 messages · Page 1 of 1 (latest)
Thank you
$ diesel print-schema
relation "bans" does not exist```
It gave me this error on my old database idk why. It is working just fine in my TS project using prisma
foobar=# \dt
List of relations
Schema | Name | Type | Owner
--------+----------------------------+-------+-----------
public | Bans | table | asdf_user
...
public | User | table | asdf_user
public | __diesel_schema_migrations | table | asdf_user
public | _prisma_migrations | table | asdf_user
(26 rows)
foobar=# \d Bans
Did not find any relation named "Bans".
foobar=# \d "Bans"
Table "public.Bans"
Column | Type | Collation | Nullable | Default
------------+--------------------------------+-----------+----------+------------------------------------
id | integer | | not null | nextval('"Bans_id_seq"'::regclass)
userId | integer | | |
createdAt | timestamp(3) without time zone | | not null | CURRENT_TIMESTAMP
msDuration | integer | | not null |
reason | text | | not null |
ip | text | | not null |
fromId | integer | | not null |
Indexes:
"Bans_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
"Bans_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"(id) ON UPDATE CASCADE ON DELETE SET NULL