{"id":19404148,"url":"https://github.com/p32929/easiestsqllibrary","last_synced_at":"2025-04-24T08:32:48.205Z","repository":{"id":38037636,"uuid":"250765570","full_name":"p32929/EasiestSqlLibrary","owner":"p32929","description":"The Easiest and Laziest approach to Android SQL Database","archived":false,"fork":false,"pushed_at":"2022-06-11T05:21:01.000Z","size":166,"stargazers_count":37,"open_issues_count":1,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-29T00:05:27.897Z","etag":null,"topics":["android","android-database","android-development","android-library","android-sqlite-database","best","database","database-management","databases","easiest","easiestsqllibrary","easy-to-use","p32929","sql","sql-query","sql-server","sqlite","sqlite-android","sqlite-database","sqlserver"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p32929.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-28T10:24:15.000Z","updated_at":"2023-12-30T15:15:06.000Z","dependencies_parsed_at":"2022-08-29T06:00:58.125Z","dependency_job_id":null,"html_url":"https://github.com/p32929/EasiestSqlLibrary","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestSqlLibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestSqlLibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestSqlLibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestSqlLibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p32929","download_url":"https://codeload.github.com/p32929/EasiestSqlLibrary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223947819,"owners_count":17230100,"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-database","android-development","android-library","android-sqlite-database","best","database","database-management","databases","easiest","easiestsqllibrary","easy-to-use","p32929","sql","sql-query","sql-server","sqlite","sqlite-android","sqlite-database","sqlserver"],"created_at":"2024-11-10T11:33:21.587Z","updated_at":"2024-11-10T11:33:22.076Z","avatar_url":"https://github.com/p32929.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasiestSqlLibrary\nThe Easiest and the Laziest approach to Android SQL Database. If you like Flutter, the flutter version of this library can be found here -\u003e [Github](https://github.com/p32929/EasiestSqlFlutter) or [pub.dev](https://pub.dev/packages/easiestdb) \n\n[![](https://badgen.net/github/release/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/release/p32929/EasiestSqlLibrary/stable)]() [![](https://badgen.net/github/tag/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/watchers/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/checks/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/status/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/stars/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/forks/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/issues/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/open-issues/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/closed-issues/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/label-issues/p32929/EasiestSqlLibrary/help-wanted/open)]() [![](https://badgen.net/github/prs/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/open-prs/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/closed-prs/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/merged-prs/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/commits/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/last-commit/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/branches/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/releases/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/tags/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/license/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/contributors/p32929/EasiestSqlLibrary)]() [![](https://badgen.net/github/dependents-pkg/p32929/EasiestSqlLibrary)]() \n\n## Share\nSharing with your friends is just one click away from here\n\n[![facebook](https://image.flaticon.com/icons/png/32/124/124010.png)](https://www.facebook.com/sharer/sharer.php?u=https://github.com/p32929/EasiestSqlLibrary)\n[![twitter](https://image.flaticon.com/icons/png/32/124/124021.png)](https://twitter.com/intent/tweet?source=https://github.com/p32929/EasiestSqlLibrary)\n[![tumblr](https://image.flaticon.com/icons/png/32/124/124012.png)](https://www.tumblr.com/share?v=3\u0026u=https://github.com/p32929/EasiestSqlLibrary)\n[![pocket](https://image.flaticon.com/icons/png/32/732/732238.png)](https://getpocket.com/save?url=https://github.com/p32929/EasiestSqlLibrary)\n[![pinterest](https://image.flaticon.com/icons/png/32/124/124039.png)](https://pinterest.com/pin/create/button/?url=https://github.com/p32929/EasiestSqlLibrary)\n[![reddit](https://image.flaticon.com/icons/png/32/2111/2111589.png)](https://www.reddit.com/submit?url=https://github.com/p32929/EasiestSqlLibrary)\n[![linkedin](https://image.flaticon.com/icons/png/32/1409/1409945.png)](https://www.linkedin.com/shareArticle?mini=true\u0026url=https://github.com/p32929/EasiestSqlLibrary)\n[![whatsapp](https://image.flaticon.com/icons/png/32/733/733585.png)](https://api.whatsapp.com/send?text=https://github.com/p32929/EasiestSqlLibrary)\n\n## Support\nIf you like my works and want to support me/my works, feel free to support or donate. My payment details can be found here: https://p32929.github.io/SendMoney2Me/\n\n## Installation\nAdd it in your root build.gradle at the end of repositories:\n```\nallprojects {\n  repositories {\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\nAdd the dependency\n```\ndependencies {\n     implementation 'com.github.p32929:EasiestSqlLibrary:1.0.0.2'\n}\n```\n\n## Basic Usage\nSteps to follow:\n1. Initialize\n2. Add Tables and Columns\n3. Call `doneAddingTables` method\n\nAfter that, you can do all kinds of CRUD ( Create, Read, Update, Delete ) operations.\n\n## Initialize the Database and the Tables\n###### EasiestDB.init(Context context)\n###### easiestDB.addTableColumns(String tableName, Column... columns)\n###### easiestDB.doneAddingTables()\n\n```\nEasiestDB easiestDB = EasiestDB.init(this)\n                    .addTableColumns(\"table 1\",\n                            new Column(\"Column a1\", \"text\"),\n                            new Column(\"Column a2\", \"text\")\n                    )\n                    .addTableColumns(\"table 2\",\n                            new Column(\"Column b1\", \"text\"),\n                            new Column(\"Column b2\", \"text\", \"unique\")\n                    )\n                    .doneAddingTables();\n```\n\n* You don't need to add the \"ID\" primary key column. ```EasiestSqlLibrary``` does that by default.\n\n## Add data\n###### easiestDB.addDataInTable(int tableIndex, Datum... data)\n###### Datum(String columnName, String value)\n###### Datum(String columnName, int value)\n###### Datum(String columnName, double value)\n###### Datum(int columnIndex, String value)\n###### Datum(int columnIndex, int value)\n###### Datum(int columnIndex, double value)\n\n```\nboolean added = easiestDB.addDataInTable(0,\n        new Datum(1, \"Value1\"),\n        new Datum(2, \"Value2\")\n);\n```\n\n## Get All data from a table\n###### easiestDB.getAllDataFrom(int tableIndex)\n###### easiestDB.getAllDataFrom(String tableName)\n\n```\nCursor cursor = easiestDB.getAllDataFrom(0);\nif (cursor != null) {\n    while (cursor.moveToNext()) {\n        int value1 = cursor.getInt(columnIndex);\n        String value2 = cursor.getString(columnIndex);\n        double value3 = cursor.getDouble(columnIndex);\n    }\n}\n```\nor\n###### easiestDB.getAllDataOrderedBy(int columnIndex, boolean ascending, int tableIndex)\n\n```\nCursor cursor = easiestDB.getAllDataOrderedBy(0, true, 0);\nif (cursor != null) {\n    while (cursor.moveToNext()) {\n        int value1 = cursor.getInt(columnIndex);\n        String value2 = cursor.getString(columnIndex);\n        double value3 = cursor.getDouble(columnIndex);\n    }\n}\n```\n\n## Get All data from a row within a table\n###### easiestDB.getOneRowData(int tableIndex, int rowNumber)\n###### easiestDB.getOneRowData(String tableName, int rowNumber)\n\n```\nCursor cursor = easiestDB.getOneRowData(0, 1); // rowNumber starts from 1 but tableIndex starts from 0\nif (cursor != null) {\n    cursor.moveToFirst();\n    int value1 = cursor.getInt(columnIndex);\n    String value2 = cursor.getString(columnIndex);\n    double value3 = cursor.getDouble(columnIndex);\n}\n```\n\n## Search value in a column within a table\n###### easiestDB.searchInOneColumn(int columnIndex, String valueToSearch, int limit, int tableIndex)\n###### easiestDB.searchInOneColumn(String columnName, String valueToSearch, int limit, int tableIndex)\n\n```\nCursor cursor = easiestDB.searchInOneColumn(1, \"Value1\", 0, 0);\nif (cursor != null) {\n    cursor.moveToFirst();\n    int value1 = cursor.getInt(columnIndex);\n    String value2 = cursor.getString(columnIndex);\n    double value3 = cursor.getDouble(columnIndex);\n}\n```\n\n## Match values in multiple columns. ( Example: Matching ID and password for a user within a table )\n###### easiestDB.searchValuesInMultipleColumns(int tableIndex, Datum... data)\n\n```\nCursor cursor = easiestDB.searchValuesInMultipleColumns(1,\n        new Datum(1, \"Value1\"),\n        new Datum(2, \"Value2\")\n);\nboolean matched = cursor.getCount() \u003e 0;\n```\n\n## Update data in a row\n###### easiestDB.updateData(int tableIndex, int rowNumber, Datum... data)\n\n```\nboolean updated = easiestDB.updateData(0, 1,\n        new Datum(1, \"Value1.1\"),\n        new Datum(2, \"Value2.2\")\n);\n```\n\n## Delete one row\n###### easiestDB.deleteRow(int tableIndex, int rowNumber)\n\n```\nboolean deleted = easiestDB.deleteRow(0, 1);\n```\n\n## Delete a row if values match in a column\n###### easiestDB.deleteRowIfValuesMatchIn(int tableIndex, Datum data)\n###### easiestDB.deleteRowIfValuesMatchIn(int tableIndex, Datum data)\n\n```\nboolean deleted = easiestDB.deleteRowIfValuesMatchIn(0,\n        new Datum(1, \"Value1\")\n);\n```\n\n## Delete all data from a table\n###### easiestDB.deleteAllDataFrom(String tableName)\n###### easiestDB.deleteAllDataFrom(int tableIndex)\n\n```\neasiestDB.deleteAllDataFrom(0)\n```\n\n## Delete the all data from the database\n###### easiestDB.deleteDatabase()\n\n```\nboolean deleted = easiestDB.deleteDatabase();\n```\n\nI hope, you will enjoy using the library. Feel free to contribute codes.\n\nIf you want to use the previous version of this library, you can still use that from here: https://github.com/p32929/AndroidEasySQL-Library\n\n#### License\n\n```\nMIT License\n\nCopyright (c) 2020 Fayaz Bin Salam\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp32929%2Feasiestsqllibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp32929%2Feasiestsqllibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp32929%2Feasiestsqllibrary/lists"}