Skip to content
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

PYTHON-4802: add support for sqlmigrate #141

Closed
timgraham opened this issue Sep 25, 2024 · 2 comments · Fixed by #153
Closed

PYTHON-4802: add support for sqlmigrate #141

timgraham opened this issue Sep 25, 2024 · 2 comments · Fixed by #153
Assignees

Comments

@timgraham
Copy link
Collaborator

timgraham commented Sep 25, 2024

Currently SchemaEditor doesn't log queries and thus the sqlmigrate command doesn't work.

Reference: Django's implementation

Also see: CollectionDebugWrapper

@aclark4life aclark4life self-assigned this Sep 26, 2024
@aclark4life
Copy link
Collaborator

aclark4life commented Sep 30, 2024

Currently SchemaEditor doesn't log queries

Django core's SchemaEditor doesn't log queries because … logging queries is not a feature of the Django core, correct? In other words, via the BaseSchemaEditor doc string its job is "emitting schema-changing statements to the databases" not logging them.

and thus the sqlmigrate command doesn't work.

Can you clarify the relationship between the SchemaEditor and sqlmigrate command? IIUC, "thus it doesn't work" includes the assumption we want to use some MongoDB-specific SchemaEditor implementation to log queries in order to output as_mql ?

@timgraham
Copy link
Collaborator Author

By "log queries" I mean appending to SchemaEditor.collected_sql. sqlmigrate gets its output from collected_sql.

@aclark4life aclark4life changed the title add support for sqlmigrate PYTHON-4802: add support for sqlmigrate Oct 1, 2024
@timgraham timgraham assigned timgraham and unassigned aclark4life Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants