#207 new
Dmytrii Nagirniak

The database should be prefixed with the environment

Reported by Dmytrii Nagirniak | December 9th, 2011 @ 04:54 AM

The database itself is stored under db/ directory.

The location should be always prefixed with current environment db/test, db/development etc so that it's save to move work with that data.

Comments and changes to this ticket

  • Andreas Ronge

    Andreas Ronge December 9th, 2011 @ 10:56 AM

    • Assigned user set to “Andreas Ronge”

    When running outside rails the default location is the db directory.
    When creating an neo4j-rails application using my template it will configure the location to the db/neo4j-development, db-neo4j-test etc
    in the config/application.rb (Neo4j::Config[:storage_path])
    Maybe we can instead use railies to do this configuration so it works for people not using my rails template.

  • Dmytrii Nagirniak

    Dmytrii Nagirniak December 9th, 2011 @ 11:31 AM

    It wasn't a big deal to set it manually as described in the docs

    The problem was that it messed up the whole db/ directory with neo* files when I first run it.

    I don't think it should enforce anybody to use rails template.
    Rails generator is a better fit for this: rails g neo4j:configure.

    This would generate the config/neo4j.yml or config/neo4j/config.yml (similarly to database.yml).

    Or maybe by default it should raise error if no configuration is available to make it explicit?

  • Andreas Ronge

    Andreas Ronge December 9th, 2011 @ 11:34 AM

    rails g neo4j:configure sound like a good solution.

  • Dmytrii Nagirniak

    Dmytrii Nagirniak December 9th, 2011 @ 11:39 AM

    Maybe you could also consider to raise error to make sure a user will actually configure or run the rails generator?

    Same will probably apply to non-rails. Enforcing to set at least the path is a good idea as it will make a user aware of the configuration.

  • Andreas Ronge

    Andreas Ronge December 9th, 2011 @ 11:46 AM

    Hmm, maybe. But I also want it super easy to get started with with no configuration at all.
    I often open an irb console and just do require 'neo4j' and start testing things out. Do not want to write another line in the IRB console just to configure the location of the database.
    I think it actually prints out the location of the database when it starts.

  • Dmytrii Nagirniak

    Dmytrii Nagirniak December 9th, 2011 @ 11:57 AM

    Makes sense, I guess there should be a fine line between no config and correct-config.

    Maybe the you could raise "Please configure the location of DB (see XYZ)." if defined(::Rails) or something similar.

    But I really don't care that much. As I said my problem was that the db/ directory was flooded with all the files.

    I also would be very upset if I would run Rails app in development mode. Then specs would wipe it off.

    That's the main concern.

  • Dmytrii Nagirniak

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket