provider-sql
provider-sql copied to clipboard
Managed database schemas
What problem are you facing?
It would be ideal to support managing database schemas declaratively using this provider.
How could Crossplane help solve your problem?
Add a Schema
managed resource to this provider? I'd love to see a sketch of what that managed resource would look like as YAML. We could probably take inspiration from https://github.com/schemahero/schemahero here.
Any updates on adding support for creating schemas?
so i'm using this provider to create a database and a role in AWS RDS instances. i'm able to do it, and also set the role as the owner of the database.
but, due to how AWS setups RDS (ie, master user is not a superuser and new roles are not owners of db schemas), i also need to change the schema owner (to the new role i'm creating). the command i need to issue is:
ALTER SCHEMA public OWNER TO <role>;
note: need to connect to the database first with the master/root user
as far as i understand from looking at the provider code, neither Database or Grant supports this use case. is anyone using this kind of stuff on AWS RDS? how are you configuring this stuff ?
i might be able to contribute to the provider, but would like to first talk with its maintainers to understand the best way to go about this:
- create a Schema type like @negz said? would work like the Database one, just not sure how it could just change ownership of something that already exists and not only creating a new schema with an owner ...
- increment Database scope somehow ( add additional fields to control changing schema ownership or not? ... )
- just set the schema owner to the same owner of the database right after creating the database? (this fits my use case but is probably the less flexible one)
- ...
thank you.
Hi,
I'm also interested on this feature, being able to manage Postgre schemas on a RDS cluster. I suppose adding a Schema object would be nice ? Not sure you need any reference to the Schema on the Database ? The Schema owner would be set on the Schema specs ?
@Bastichou, @dneves - see PR #181 for CREATE SCHEMA support (including owner).
I think @negz is talking about a full fledged schema hero replacement (Table etc)