Comments (14)
In GitLab by @manuelma on Nov 16, 2018, 18:24
mentioned in commit c26d539
from spine-database-api.
In GitLab by @manuelma on Nov 16, 2018, 20:55
mentioned in commit toolbox@a29d7e32c21f099556ff9549a9f21d18841bef90
from spine-database-api.
In GitLab by @manuelma on Nov 17, 2018, 00:48
mentioned in commit toolbox@9f81d59a1713e06f3f086986bf2b74c263f1728e
from spine-database-api.
In GitLab by @manuelma on Nov 21, 2018, 12:39
mentioned in commit 61a5a77
from spine-database-api.
In GitLab by @manuelma on Nov 24, 2018, 23:10
mentioned in commit toolbox@e248e16fa4fec232dcd37ee015efcde6b939245a
from spine-database-api.
In GitLab by @manuelma on Mar 25, 2019, 17:42
assigned to @manuelma
from spine-database-api.
In GitLab by @manuelma on Mar 25, 2019, 17:46
@PekkaSavolainen @PvPer @ererkka
The difficulty here is we only delete diff_ tables from the database when the close
method is called on the DiffDatabaseMapping
object. It works well as long as one remembers and doesn't make Python crash. It's awful when developing.
Do you know if it's possible to manage this better? I've looked at Python destructors and it doesn't seem to be the answer here. People also recommend the context manager approach.
Help?
from spine-database-api.
In GitLab by @PvPer on Mar 26, 2019, 09:07
I think the whole diff thing is a bit hacky to begin with, we are essentially rewriting sessions for sqlite.
There is a plugin, https://sqlite.org/sessionintro.html, probably not straightforward to use in python.
Use the sqlalchemy session more. It does some session work, but not sure if it can do all we want.
Use a in memory database or temporary file and then attach that database to the original via the attach
command: https://sqlite.org/lang_attach.html
Use temp tables instead: https://www.sqlite.org/tempfiles.html#temp_databases, this seems to be what we want, creates a temporary extra file that is removed when the session is closed, not sure what happens if the session crashes but we should try this one out.
from spine-database-api.
In GitLab by @PekkaSavolainen on Mar 26, 2019, 10:56
changed title from Delete diff tables when session cr{-u-}shes to Delete diff tables when session cr{+a+}shes
from spine-database-api.
In GitLab by @manuelma on Mar 26, 2019, 21:10
mentioned in commit bb52556
from spine-database-api.
In GitLab by @manuelma on Mar 26, 2019, 21:13
The temp tables approach seems to work, so I just went with that. Please let me know if I broke something.
(The trick to make it work is to use the same Connection
object both to create the temp tables, and the Session
. Otherwise, the Session
is unable to see the temp tables.)
In the future we may come up with a less hacky approach, but for now this seems to work just fine (apart from this detail, which I hope is now solved).
Thanks for the input @PvPer
from spine-database-api.
In GitLab by @manuelma on Mar 29, 2019, 20:33
mentioned in commit d08b25a
from spine-database-api.
In GitLab by @manuelma on Mar 29, 2019, 20:33
mentioned in commit toolbox@ab9ccc795270398ead5a62098ef8cf88545cbf55
from spine-database-api.
In GitLab by @manuelma on May 30, 2019, 19:04
This is handled for sqlite backend, remains to check other backends.
from spine-database-api.
Related Issues (20)
- Restablish unique key 'name' for entity_class
- Parameter values as Apache Arrow objects HOT 4
- Can't trust legacy tool/feature/method for compatibility transformations
- Write type information for simple types as well HOT 6
- Rollback purge HOT 1
- Add Toolbox tests to GitHub actions? HOT 3
- Parameter value format documentation is missing index_name
- Wrong results after changing a filter
- Make sure TempId travel safely across the socket (DB server)
- The tool filter only works with 1 tool activated
- No entity can pass its tool filter when there are multiple `tool_feature_method`s HOT 1
- Fix broken example in parameter_value API documentation
- Guidelines on what to import in __init__.py
- Improve parsing performance by accepting only ISO 8601 time stamps HOT 2
- Check that CHANGELOG.md is up-to-date for 0.8-dev HOT 1
- Compatibility transformation should keep working after the first time HOT 1
- Alternative filter does not filter by entity alternatives
- Trying to get a parameter value that does not exist Tracebacks
- Mention the difference between entity_byname and element_name_list in documentation HOT 2
- Support EPS Value in GDX Exporter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spine-database-api.