Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Information Management

    Goatfish 0.1

    Download button

    No screenshots available
    Downloads: 248  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Stochastic Technologies | More programs
    BSD License / FREE
    February 16th, 2012, 17:49 GMT
    ROOT / Information Management

     Read user reviews (0)  Refer to a friend  Subscribe

    Goatfish description

    A small, schemaless ORM that is backed by SQLite

    Goatfish is a small, schemaless ORM that is backed by SQLite.

    Goatfish supports persisting arbitrary objects (anything the pickle module can handle) to database and indexing on arbitrary properties of the objects.

    Its usage is very simple, just have your classes inherit from goatfish.Model and and specify a connection, and the goatfish methods are available to you. goatfish also supports querying for arbitrary properties in your models, as well as indexing on arbitrary properties. It does not enforce a schema of any kind.

    It appears that this method is identical to what FriendFeed used to implement a schemaless layer over MySQL, which is pretty significant validation:

    http://backchannel.org/blog/friendfeed-schemaless-mysql

    Installation

    You have multiple options of installation:

    - With pip (preferred), do pip install goatfish.
    - With setuptools, do easy_install goatfish.
    - To install the source, download it from https://github.com/stochastic-technologies/goatfish/ and do python setup.py install.

    Usage

    To use goatfish, all you need to do is create a class that inherits from goatfish.Model:

    import goatfish
    import sqlite3

    class Test(goatfish.Model):
     class Meta:
     # This is so we know where to connect.
     connection = sqlite3.connect(":memory:")


    # Create the necessary tables. If they exist, do nothing.
    Test.initialize()

    foo = Test()
    foo.bar = "hello"
    foo.save()

    # Retrieve all elements.
    >>> [test.bar for test in Test.find()]
    ['hello']

    # Run a query with parameters (slow, loads every item from the DB to check it).
    >>> [test.bar for test in Test.find({"bar": "hello"})]
    ['hello']

    # Run a query with a parameter that doesn't exist in the dataset.
    >>> [test.bar for test in Test.find({"bar": "hello", "baz": "hi"})]
    []

    # Delete the element.
    >>> foo.delete()

    # Try to retrieve all elements again.
    >>> [test.bar for test in Test.find()]
    []



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    schemaless ORM | arbitrary objects | schemaless | ORM | arbitrary

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM