{"id":19637298,"url":"https://github.com/walidabazo/sqliteunity3d_android","last_synced_at":"2025-07-08T00:38:30.934Z","repository":{"id":167582052,"uuid":"180921568","full_name":"walidabazo/SQLiteUnity3d_Android","owner":"walidabazo","description":"SQLite Unity 3d For ( Android , Windows Phone , Windows , IOS, WINRT )","archived":false,"fork":false,"pushed_at":"2021-04-17T02:48:30.000Z","size":4375,"stargazers_count":42,"open_issues_count":1,"forks_count":14,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-11T12:11:42.581Z","etag":null,"topics":["android","android-app","database","insert","ios","ios-app","package","query","search","select","sql","sql-query","sqlite","sqlite-android","sqlite3","table","unity","unity3d","update","webar"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walidabazo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-04-12T03:15:19.000Z","updated_at":"2025-02-20T07:03:20.000Z","dependencies_parsed_at":"2023-05-28T23:15:48.819Z","dependency_job_id":null,"html_url":"https://github.com/walidabazo/SQLiteUnity3d_Android","commit_stats":null,"previous_names":["walidabazo/sqliteunity3d_android"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/walidabazo/SQLiteUnity3d_Android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walidabazo%2FSQLiteUnity3d_Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walidabazo%2FSQLiteUnity3d_Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walidabazo%2FSQLiteUnity3d_Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walidabazo%2FSQLiteUnity3d_Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walidabazo","download_url":"https://codeload.github.com/walidabazo/SQLiteUnity3d_Android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walidabazo%2FSQLiteUnity3d_Android/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264169448,"owners_count":23567304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","database","insert","ios","ios-app","package","query","search","select","sql","sql-query","sqlite","sqlite-android","sqlite3","table","unity","unity3d","update","webar"],"created_at":"2024-11-11T12:33:59.517Z","updated_at":"2025-07-08T00:38:30.906Z","avatar_url":"https://github.com/walidabazo.png","language":null,"readme":"## SQLite Unity3d For ( Android , Wondows Phone , Windows , IOS, WINRT )\n#### Connection Database Sqlite how to Create Table  , Select , Insert , Update , Delete , Search\n\n\n[![Watch the video](https://img.youtube.com/vi/dezAuScV9ZY/0.jpg)](https://youtu.be/dezAuScV9ZY)\n\nShow Tutorial SQLite Unity3d ( Android , Windows Phone , Windows , IOS, WINRT )\n\nhttps://shorturl.edafait.com/?SQLiteUnity3d\n\n\n## YouTube Channel Wonder developer To Subscriber \nhttps://shorturl.edafait.com/?Subscribe\n\n\n### Must Be Add this Refranace\n\n\nusing Mono.Data.Sqlite;\n\nusing System;\n\nusing System.Data;\n\nusing System.IO;\n\nusing UnityEngine.UI;\n\n\n\n### interface enables you to implement a Connectionclass\n\nprivate string conn, sqlQuery;\n\nIDbConnection dbconn;\n\nIDbCommand dbcmd;\n\nprivate IDataReader reader;\n\t\n### Database \tName\nstring DatabaseName = \"Yourdatabasename.s3db\";\n\n### For all platform\nstring filepath = Application.dataPath + \"/Plugins/\" + DatabaseName;\n\n###  Application database Path android\n string filepath = Application.persistentDataPath + \"/\" + DatabaseName;\n \n \n### DatabBase Path for Android \n\n           // If not found on android will create Tables and database\n\n            Debug.LogWarning(\"File \\\"\" + filepath + \"\\\" does not exist. Attempting to create from \\\"\" +\n                             Application.dataPath + \"!/assets/Employers\");\n\n\n\n            // #UNITY_ANDROID\n            WWW loadDB = new WWW(\"jar:file://\" + Application.dataPath + \"!/assets/Employers.s3db\");\n            while (!loadDB.isDone) { }\n            // then save to Application.persistentDataPath\n            File.WriteAllBytes(filepath, loadDB.bytes);\n            \n        \n            \n### Databasde SQLite Path IOS \n\n// #UNITY_IOS\n\n\n    var loadDb = Application.dataPath + \"/Raw/\" + DatabaseName;\n    // this is the path to your StreamingAssets in iOS\n    // then save to Application.persistentDataPath\n    File.Copy(loadDb, filepath);\n\n\n\n\n### DatabBase Path for Windows Phone :\n\n // #UNITY_WP8\n \n    var loadDb = Application.dataPath + \"/StreamingAssets/\" + DatabaseName;  \n    // this is the path to your StreamingAssets in iOS\n    //then save to Application.persistentDataPath\n    File.Copy(loadDb, filepath);         \n\n\n\n### DatabBase Path for  WINRT\n\n // #UNITY_WINRT\n \n      var loadDb = Application.dataPath + \"/StreamingAssets/\" + DatabaseName;  \n     // this is the path to your StreamingAssets in iOS\n    // then save to Application.persistentDataPath\n    File.Copy(loadDb, filepath);\n      \n \n\n### open Database SQlite Unity  connection\n        conn = \"URI=file:\" + filepath;\n\n        Debug.Log(\"Stablishing connection to: \" + conn);\n        dbconn = new SqliteConnection(conn);\n        dbconn.Open();\n\n### To Create Table  Sqlite\nThis Example:\n\nTable Name (Staff) Have ID is PRIMARY KEY , Name, Address\n\n        string query;\n        query = \"CREATE TABLE Staff (ID INTEGER PRIMARY KEY   AUTOINCREMENT, Name varchar(100), Address varchar(200))\";\n        try\n        {\n            dbcmd = dbconn.CreateCommand(); // create empty command\n            dbcmd.CommandText = query; // fill the command\n            reader = dbcmd.ExecuteReader(); // execute command which returns a reader\n        }\n        catch (Exception e)\n        {\n\n            Debug.Log(e);\n\n        }\n\t\n### To Select  Sqlite\n\n\n    string Name_readers, Address_readers;\n    using (dbconn = new SqliteConnection(conn))\n        {\n            dbconn.Open(); //Open connection to the database.\n            IDbCommand dbcmd = dbconn.CreateCommand();\n            string sqlQuery = \"SELECT  Name, Address \" + \"FROM Staff\";// table name\n            dbcmd.CommandText = sqlQuery;\n            IDataReader reader = dbcmd.ExecuteReader();\n            while (reader.Read())\n            {\n              \n                Name_readers = reader.GetString(0);\n                Address_readers = reader.GetString(1);\n\n               \n                Debug.Log(\" name =\" + Name_readers + \"Address=\" + Address_readers);\n            }\n            reader.Close();\n            reader = null;\n            dbcmd.Dispose();\n            dbcmd = null;\n            dbconn.Close();\n\t    \n\t    \n### To Insert  Sqlite\n\n    using (dbconn = new SqliteConnection(conn))\n        {\n            dbconn.Open(); //Open connection to the database.\n            dbcmd = dbconn.CreateCommand();\n            sqlQuery = string.Format(\"insert into Staff (name, Address) values (\\\"{0}\\\",\\\"{1}\\\")\", name, Address);// table name\n            dbcmd.CommandText = sqlQuery;\n            dbcmd.ExecuteScalar();\n            dbconn.Close();\n        }\n    \n        Debug.Log(\"Insert Done  \");\n\t\n### To Update  Sqlite\t\n\n      using (dbconn = new SqliteConnection(conn))\n        {\n            dbconn.Open(); //Open connection to the database.\n            dbcmd = dbconn.CreateCommand();\n            sqlQuery = string.Format(\"UPDATE Staff set name = @name ,address = @address where ID = @id \");\n\n            SqliteParameter P_update_name = new SqliteParameter(\"@name\", update_name);\n            SqliteParameter P_update_address = new SqliteParameter(\"@address\", update_address);\n            SqliteParameter P_update_id = new SqliteParameter(\"@id\", update_id);\n\n            dbcmd.Parameters.Add(P_update_name);\n            dbcmd.Parameters.Add(P_update_address);\n            dbcmd.Parameters.Add(P_update_id);\n\n            dbcmd.CommandText = sqlQuery;\n            dbcmd.ExecuteScalar();\n            dbconn.Close();\n            Search_function(t_id.text);\n        }\n\t\n### To Search By ID\n  \n    using (dbconn = new SqliteConnection(conn))\n         {\n            string Name_readers_Search, Address_readers_Search;\n            dbconn.Open(); //Open connection to the database.\n            IDbCommand dbcmd = dbconn.CreateCommand();\n            string sqlQuery = \"SELECT name,address \" + \"FROM Staff where id =\" + Search_by_id;// table name\n            dbcmd.CommandText = sqlQuery;\n            IDataReader reader = dbcmd.ExecuteReader();\n            while (reader.Read())\n            {\n                \n                Name_readers_Search = reader.GetString(0);\n                Address_readers_Search = reader.GetString(1);\n                data_staff.text += Name_readers_Search + \" - \" + Address_readers_Search + \"\\n\";\n\n                Debug.Log(\" name =\" + Name_readers_Search + \"Address=\" + Address_readers_Search);\n\n            }\n            reader.Close();\n            reader = null;\n            dbcmd.Dispose();\n            dbcmd = null;\n            dbconn.Close();\n\t    \n\t    \n\t    \n## Can be start web Augmented reality\nHttps://Webxr.edafait.com\n\n## Good Company hosting and low price VPN \nhttps://shorturl.edafait.com/?fZVHLor \n\n## YouTube Channel Wonder developer To Subscriber \nhttps://shorturl.edafait.com/?zuS4kvW\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalidabazo%2Fsqliteunity3d_android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalidabazo%2Fsqliteunity3d_android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalidabazo%2Fsqliteunity3d_android/lists"}