Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

EasySQLite v1.1 - using sqlite manager third party tool [Released]

Discussion in 'Assets and Asset Store' started by FreCre, Jan 12, 2015.

  1. FreCre

    FreCre

    Joined:
    Nov 27, 2014
    Posts:
    3
    EasySQLite is a plugin in unity to use SQLite database. As for developer, it's really important to save the information in selected path, especially if you're on mobile application development.
    Direct link to Asset Store

    sql-ass.png
    Publisher's Website | Documentation

    Proven to run in this platforms :
    iOS
    Android


    Easy to execute queries such us :
    Insert
    Delete
    Updating data

    many more..

    This has been updated, we improve our Script and Documentation to make it much easier to understand.
    And added video tutorial on how to use EasySQLite.
    How to use..
    1. Please install the package “EasySQLite.unitypackage”
    2. Please make ensure whether these file is placed in the following path on Project.
    • EasySQLite/EasySQLiteManager.csPlugins/Android/libsqlite3
    • StreamingAssets/(your database file; under StreamingAssets folder)
    3. Create a Database
    4. Attach EasySQLiteManager.cs to GameObject in Scene.

    5. Drag also the script where you declared you're database

    Example: DemoEasySQLiteDYnamicController.cs and if you already did, then drag the GameOject on that component.​

    Please take note: You should declared for initialization EasySQLiteManager public inside your script so that this instruction will be possible.Please refer to our script controller endings.​

    6. Please choose Settings and write Database name in the Inspector of instruction 4;

    DebugSetting:
    AndroidPathSettings:
    iOSPathSettings:
    EditorPathSettings:
    RefreshSettings:
    DatabaseFilename:

    Reminder: When you put your database, the extension name should be include.​

    Example: DemoSQLiteDynamicDB.bytes
    .bytes is the extension and this is really important if you want to access the database that you made from instruction 3.​

    7. Please get the Instance in your code to use SQLite.

    8. Please make Model Class that you want to use in database;
    • We suggest it will be the same as what you use in the database that you create in instruction 3.
    • You can use whether Boolean, String, Short, Int, Long, Double, Float for field.
    Note : When using Insert, Delete, and Update put [EasySQLiteManager.PrimaryKey] to key field.​

    Example:
    Code (CSharp):
    1. //Initialize name data inside the database
    2.     private class Item
    3.     {
    4.         [EasySQLiteManager.PrimaryKey]
    5.         public int id{ get; set; }
    6.  
    7.         public string name{ get; set; }
    8.  
    9.         public int count{ get; set; }
    10.     }

    9. Then lets call any Method you want.
    • About the details please check .Documentation
    • Before you call any method, please make sure the table is in the database.
    • About making table, you can create dynamically by sql.

    Example:
    Code (CSharp):
    1. //Create table if the specified database is not yet created
    2.  
    3.     private void CreateTable ()
    4.     {
    5.         string sql = "CREATE TABLE \"DynamicItem\" " +
    6.             "(\"id\" INTEGER PRIMARY KEY NOT NULL, " +
    7.             "\"name\" Text," +
    8.             "\"count\" INTEGER)";
    9.  
    10.         dynamicDB.ExecuteNonQuery (sql);
    11.     }
    12.  

    Additional Information:
    In one Scene you initialize multiple EasySQLiteManager to use different setting database.​

    Operation for this plugin is not guarantee, but we give assistance as much as we can.

    If there's bug please let us know, we will correspond within the range that can be done to improve in the future updates.
     
    Last edited: Feb 1, 2015
  2. rayfigs

    rayfigs

    Joined:
    Feb 8, 2009
    Posts:
    41
    You mention that .bytes file is important. How does one create a .bytes file from sqlite manager?

    Thanks,
    Reinaldo
     
  3. zedzag

    zedzag

    Joined:
    Mar 16, 2015
    Posts:
    4
    when testing on ios device, insert query fails with error "Attempt to write to readonly database". What is the solution for that. it works fine in editor/android just ios has this issue.