ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 31 May 2013 06:13:24 +0200where is `sage.databases.db.Database-`https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/I am trying to port some older Sage code (I think for Sage 5.4 or so). It uses `sage.databases.db.Database` but that doesn't seem to exist anymore. Where is it?
The file I'm trying to update is [`euler_database.py`](https://github.com/williamstein/psage/blob/master/psage/ellff/euler_database.py).
---
Edit: Can I just use
from sage.databases.all import SQLDatabase as Database
?
Sat, 25 May 2013 11:36:30 +0200https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/Answer by kcrisman for <p>I am trying to port some older Sage code (I think for Sage 5.4 or so). It uses <code>sage.databases.db.Database</code> but that doesn't seem to exist anymore. Where is it?</p>
<p>The file I'm trying to update is <a href="https://github.com/williamstein/psage/blob/master/psage/ellff/euler_database.py"><code>euler_database.py</code></a>.</p>
<hr/>
<p>Edit: Can I just use</p>
<pre><code>from sage.databases.all import SQLDatabase as Database
</code></pre>
<p>?</p>
https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/?answer=14970#post-id-14970See [Trac 10353](http://trac.sagemath.org/sage_trac/ticket/10353), where this was indeed removed to allow us to remove ZODB as a dependency. You may be able to use [the Conway polynomial database rewrite](http://trac.sagemath.org/sage_trac/ticket/12205) or [Cremona table rewrite](http://trac.sagemath.org/sage_trac/ticket/11587) to move to SQLite. I'm not sure it would be completely trivial to just use that backend, though of course you can try!
----------
(On a related note (not for the OP), does anyone know whether psage stuff is ever tested as to whether it at least *compiles* or *imports* with a given version of Sage? This probably could have easily been avoided.Sat, 25 May 2013 13:15:30 +0200https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/?answer=14970#post-id-14970Comment by Albert Zeyer for <p>See <a href="http://trac.sagemath.org/sage_trac/ticket/10353">Trac 10353</a>, where this was indeed removed to allow us to remove ZODB as a dependency. You may be able to use <a href="http://trac.sagemath.org/sage_trac/ticket/12205">the Conway polynomial database rewrite</a> or <a href="http://trac.sagemath.org/sage_trac/ticket/11587">Cremona table rewrite</a> to move to SQLite. I'm not sure it would be completely trivial to just use that backend, though of course you can try!</p>
<hr/>
<p>(On a related note (not for the OP), does anyone know whether psage stuff is ever tested as to whether it at least <em>compiles</em> or <em>imports</em> with a given version of Sage? This probably could have easily been avoided.</p>
https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/?comment=17608#post-id-17608I tried so far as that I just did that (see my commits [here](https://github.com/martinra/psage/pull/1)) and it imports fine but I'm not sure if it really works. That was not important for me as other stuff from PSage works now (which failed before because of the failing import) with a more recent Sage (5.8 and 5.9).Fri, 31 May 2013 06:13:24 +0200https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/?comment=17608#post-id-17608Answer by vdelecroix for <p>I am trying to port some older Sage code (I think for Sage 5.4 or so). It uses <code>sage.databases.db.Database</code> but that doesn't seem to exist anymore. Where is it?</p>
<p>The file I'm trying to update is <a href="https://github.com/williamstein/psage/blob/master/psage/ellff/euler_database.py"><code>euler_database.py</code></a>.</p>
<hr/>
<p>Edit: Can I just use</p>
<pre><code>from sage.databases.all import SQLDatabase as Database
</code></pre>
<p>?</p>
https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/?answer=14972#post-id-14972If I am not mistaken, your database looks more like a list of objects (rather than a list of objects with some of their invariants). The SQL framework is perhaps not the simplest way to achieve it. You may have a look at the Conway database in `sage.databases.conway` which is simply a dictionnary which is stored on hard drive using python pickling.Sat, 25 May 2013 13:27:38 +0200https://ask.sagemath.org/question/10154/where-is-sagedatabasesdbdatabase-/?answer=14972#post-id-14972