Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 1.01 KB

README.md

File metadata and controls

53 lines (44 loc) · 1.01 KB

U3Database

A Unity3D/C# wrapper around SQLite

PROVIDE

  • Read data from sqlite / Write data into sqlite
  • Transaction sql
  • TODO
    • Generate data template depend on sqlite table structure
    • Deserialize sql result into object
    • Excel support

HOW TO USE

UPDATE

U3Database db = U3Database.DatabaseWithPath(Application.dataPath + "/test.db");
db.Open();
db.Update("UPDATE Main SET Value=3 WHERE ID=1");
db.Update("Main", "Value", 5);
db.Update("Main", "Value", 6, "ID=1");
db.Update("Main", "Value", 9, "ID", 2);

SELECT

U3DBResultSet result = null;
result = db.Select("SELECT * FROM MAIN");
result.Show();
result = db.Select("Main", "ID", 1);
result.Show();

INSERT

db.Insert("Main", "Value", 888);
db.Insert("Main", "Value", 999, "Description", "???");

TRANSACTION

db.BeginTransaction(delegate(ref bool rollback)
{
    db.Update("Main", "Value", 0);
    rollback = true;
});

REQUIRE

  • Unity 3D 4.x/5.x

REFERENCE