Skip to content

MichaelAz/TINA-ORM

Repository files navigation

#TINA-ORM

TINA-ORM (This Is Not An ORM) is a NoSQL-ish interface to SQL databases (Currently supporting Microsoft SQL Server, MySQL and PostgreSQL) inspired by RavenDB. Get it on NuGet.

Tina works with POCOs (Plain Old CLR Objects). That means no custom attributes, no enforced conventions and zero ceremony. Batteries and a coupon for a free hug included.

#Cool Stuff Tina Can Do

##Store stuff

    MyAwesomeClass myAwesomeVariable = new MyAwesomeClass();
    DoStuff(myAwesomeVariable);

    // Initialize a new instance of Tina
    string connectionString = "Data Source=..."

    // Tina also supports the more traditional new statement. Check the wiki for more info.
    Tina tina = Tina.ConnectsTo<MsSql>(connectionString);     

    // Store that variable, just like that.
    tina.Store(myAwesomeVariable);

##Query stuff

    string connectionString = "Data Source=..."
    Tina tina = Tina.ConnectsTo<MsSql>(connectionString);
    
    // LINQ - all the cool kids do it
    var awesomePossums = from awesomeInstance in tina.Query<MyAwesomeClass>
                         where awesomeInstance.Order == "Didelphimorphia" // That's Latin for possum
                         select awesomeInstance;

##Update stuff

    string connectionString = "Data Source=..."
    Tina tina = Tina.ConnectsTo<MsSql>(connectionString);     
    
    var awesomePossums = from awesomeInstance in tina.Query<MyAwesomeClass>
                         where awesomeInstance.Order == "Didelphimorphia"
                         select awesomeInstance;

    foreach (var possum in awesomePossums)
    {
        possum.Species = "Marmosa constantiae"; //White-bellied woolly mouse opossum, the king of Opossums 
    }

    // Updating your data - even your grandma could do it!
    tina.SaveChanges();

##Delete stuff

    string connectionString = "Data Source=..."
    Tina tina = Tina.ConnectsTo<MsSql>(connectionString);
    
    var awesomePossums = from awesomeInstance in tina.Query<MyAwesomeClass>
                         where awesomeInstance.Order == "Didelphimorphia"
                         select awesomeInstance;

    foreach (var possum in awesomePossums)
    {
        // We're switching to platypodes for standard compliance reasons...
        // By the by, platypodes, not platipi, is the plural of platypus. 
        // Tina - The only Open Source project that uses the correct Greek plural of platypus©
        tina.Delete(possum);
    }

##And more! Tina supports other databases (with great extensibility options), custom serializers and other cool stuff! Check the wiki for more cool stuff!

About

TINA-ORM (This Is Not An ORM) is a NoSQL-ish interface to SQL databases inspired by RavenDB.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages