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

Table definition requires a database connection #12

Open
eudoxia0 opened this issue Aug 31, 2014 · 2 comments
Open

Table definition requires a database connection #12

eudoxia0 opened this issue Aug 31, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@eudoxia0
Copy link
Owner

Introduced by #5.

Reported by fortitude on #lisp:

<fortitude> eudoxia: with crane, did you intend to require a connected database to define new tables?
<eudoxia> fortitude: no, see https://github.com/eudoxia0/hermetic/blob/master/contrib/crane/crane.lisp
<eudoxia> fortitude: the creation of tables is deferred until the user calls build on them manually
<eudoxia> i think that's the right use of deferred
<fortitude> eudoxia: that's what I was expecting, but your fix for issue #5 broke it
<fortitude> wasn't sure what your intent was
<eudoxia> fortitude: i haven't touched hermetic's crane integration in a while, yeah, it's probably broken
<eudoxia> thanks for pointing that out, i'll take a look at it
<fortitude> eudoxia: the problem is in your mop finalization, you check to see if the db type is sqlite
<fortitude> seems like it could be tricky to fix
<eudoxia> fortitude: i think there might be a simple fix. moving the call to closer-mop:finalize-inheritance away from the deftable macro and to the build function
@eudoxia0 eudoxia0 added the bug label Aug 31, 2014
@eudoxia0
Copy link
Owner Author

Update: I've refactored the connection code so Crane knows about a table before connecting to it. However, I've yet to add the code to "defer" table creation until a connection to the proper database is acquired.

@eudoxia0 eudoxia0 self-assigned this Jan 7, 2016
@eudoxia0 eudoxia0 added this to the Crane v1.0 milestone Jan 7, 2016
@eudoxia0
Copy link
Owner Author

eudoxia0 commented Jan 7, 2016

For Crane 1.0/the Great Rewrite, you will be able to define databases at any point, then explicitly open connections when you want.

eudoxia0 added a commit that referenced this issue Jan 8, 2016
Sessions associate tables to databases, allowing both multiple concurrent connections and for table definitions to be decoupled from database definitions. This was one of the biggest problems with Crane 0.X, see #12, #43.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant