Opened 6 years ago
Closed 6 years ago
#30369 closed New feature (wontfix)
Creating database tables from queries based on ORM API
Reported by: | Markus Elfring | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | database tables, queries, ORM, API, SQL, storage management, object-relational mapping, computation results, CTAS |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Value combinations can be counted in records also together with the software “Django 2.2” by database services.
I am looking for ways to store a computation result into a dynamically generated table.
- How should such table creation be achieved by the programming interface “object-relational mapping”?
- Would you like to support the SQL command “CREATE TABLE AS SELECT” (CTAS)?
Change History (5)
follow-up: 2 comment:1 by , 6 years ago
Version: | 2.2 → master |
---|
follow-up: 3 comment:2 by , 6 years ago
Replying to felixxm:
- Does the functionality “materialized view” provide run time characteristics which are similar to the CTAS command?
- Does it belong to the SQL standard?
- The support for it varied between databases over time. How will the software evolve further in this area?
follow-up: 4 comment:3 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
- Does the functionality “materialized view” provide run time characteristics which are similar to the CTAS command?
Yes it is quite similar, db will recognize column types.
- Does it belong to the SQL standard?
I'm not sure, but I don't think so.
- The support for it varied between databases over time.
Materialized views are supported on PostgreSQL and Oracle.
- How will the software evolve further in this area?
Do you mean by databases? I don't know answer for such existential question :)
Please use one of support channels if you have other support questions related with Django. If you have questions about databases you should probably ask somewhere else e.g. on StackOverflow.
comment:4 by , 6 years ago
Resolution: | wontfix |
---|---|
Status: | closed → new |
Replying to felixxm:
I'm not sure, but I don't think so.
I would find the support for the SQL standard statement “CREATE TABLE AS SELECT” (CTAS) nicer (while working with materialized views can be similarly useful).
comment:5 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Please start a new thread on `django-developers` if you really think that support for CREATE TABLE AS SELECT
should be added to the Django ORM. IMO use case is really narrow because even if you will create such table in ORM it will be tricky to make it accessible via ORM.
We can reopen this ticket if we reach consensus on django-developers
.
I don't think that we will support
CREATE TABLE AS SELECT
. In your use case I would createMATERIALIZED VIEW
(orVIEW
) in a migrations with raw SQL. Such views can be introspected automatically (see inspectdb) and used via Django ORM (see managed option).