Implementing my custom SchemaSource
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the SchemaSource and DBSchemaSource entry points, including GetSchema, and inspect the schemaSourcePlanDeps and Schema types. Determine whether exposing those types and supporting serialization fits the library's public API; done means a custom remote SchemaSource can exchange schemas without temporary databases.
Written by the indexing model from the issue text.
Description
Hi there 👋
Because of our infra setup, I don't have direct access to the databases I want to diff.
That's why I opted for getting pg_dumps of both DBs and using DDLSchemaSource. But I realized this is not a viable option either because I cannot create temporary DBs where my code runs.
So after digging into your code a bit more, I think that the cleanest solution to this would be implementing my own SchemaSource with my custom GetSchema() function that would work something like this for both DBs I want to diff:
- Call some API endpoint in the machine where my DB is
- The API would connect to the actual DB, wrap it into a DBSchemaSource to call GetSchema()
- Serialize the schema and send it back
Having said that, in order to implement my custom SchemaSource, I would need these two things:
- The type schemaSourcePlanDeps to be public
- The type Schema to be public so I can serialize it and send it from one place to another. (Even if it changes in the future, serializing and deserializing again should work just fine)
Hopefully I've explained myself clear enough...
So my question is, would it be possible for you to release those changes or what I'm asking goes against something you have in mind with your library?
Thanks in advance!
- Dominant language
- Go
- Stars
- 884
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stripe/pg-schema-diff
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 76/100
stripe/pg-schema-diff#302 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stripe/pg-schema-diff#283 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
stripe/pg-schema-diff#301 ·
-
Is the repo active? Open
Difficulty 1/5 Under an hour Newbie friendliness 15/100
stripe/pg-schema-diff#289 · 7 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
stripe/pg-schema-diff#284 ·
All issues in stripe/pg-schema-diff
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100