Use sql comments as output by `diesel print-schema`, if present
How should this be supported? - I'm thinking:
CREATE TABLE "profiles" (
alias VARCHAR(50) PRIMARY KEY -- user-modifiable alias
);
Or maybe:
COMMENT ON COLUMN profiles.alias IS 'user-modifiable alias';
Or something else? - What do you think?
Here's the current code FWIW: https://github.com/Wulf/dsync/blob/2797966/src/code.rs#L360
I do not understand what this feature request is. Are you asking to support using column documentation from the raw .sql files?
If that is the case, then dsync will very likely not support that as dsync only reads the schema.rs file as output by diesel print-schema. If in the future that command should output those comments, then it would be a good option to add such a thing to dsync.
Ok so you're saying I should send a PR to diesel with this?
Is there a preferred way you want it, e.g., one of the approaches I just mentioned?
Is there a preferred way you want it, e.g., one of the approaches I just mentioned?
That is better asked the diesel developers.
Ok so you're saying I should send a PR to diesel with this?
Yes, dsync does not read the raw sql files or interacts with any live databases, it only reads schema.rs which is generated by diesel print-schema, which in turn does interact with live databases (IIRC).
PS: diesel print-schema already outputs some comments, just not from the sql file(s) or the live database to my knowledge, see this example output.
Ok I've made a new issue on diesel; would appreciate your commentary there if you have an opinion :)
https://github.com/diesel-rs/diesel/discussions/4375
Considering that https://github.com/diesel-rs/diesel/discussions/4375 mentions that print-schema --with-docs already reads and output sql comments, it is reasonable to re-open this issue.
Great. Checking in on this issue; need a hand for the implementation side @hasezoey ?
@SamuelMarks if you want to make a PR for it, you can. I am currently not really developing dsync, but will review and merge if possible.