Proposal for create/destroy database
See original GitHub issueThere is a common use case of creating/destroying databases, for example when running tests.
Currently there is no support for automating detecting the source database and acting appropriately, for example;
x = SqliteDatabase("file:/tmp/lala.sql", uri=True)
x.create_database() # this would create /tmp/lala.sql
x.destroy_database() # this would unlink /tmp/lala
x = SqliteDatabase(":memory:", uri=True)
x.create_database() # this would create in-memory db space
x.destroy_database() # this would close all connections, thus destroying DB space
x = MySQLDatabase(host='127.0.0.1', database='helloworld')
x.create_database() # this would execute "CREATE DATABASE helloworld;"
x.destroy_database() # this would execute "DROP DATABASE helloworld;"
I’ve got the majority of the above working for Sqlite, however I haven’t done Postgres or MySQL yet.
If this was put forward as a well formed PR, would this sort of functionality be accepted into the core, or playhouse?
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Staged Database Systems - CMU School of Computer Science
My thesis proposal introduces the Staged Database System design for ... they update the server's statistics, and create/destroy the client's state and ...
Read more >Domain model and PHP's create/destroy nature - PHP - SitePoint ...
I'm just thinking that because PHP continually needs to work with persistent storage… databases primarily, how far does one go with the “pure”...
Read more >create-destroy-job — OCI CLI Command Reference 2.22.0 ...
Specifies the source of the execution plan to apply. Currently, only AUTO_APPROVED is allowed, which indicates that the job will be run without...
Read more >How to Implement Multi-Master Replication in Polyhedra
ments on the underlying database and is not easy to port to another DBMS since it makes use of Polyhedra specific API's. The...
Read more >Proceedings of the Object-Oriented Database Task Group ...
The workshop attempted to focus on concrete proposals ... PROPOSITION U: Functions, including database procedures and methods, and.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve always felt that this type of thing did not belong as a part of peewee. I will pass on this feature.
for future MySQL readers, the way I chose to do this (after ending up here) was this: