{"id":15050598,"url":"https://github.com/p32929/easiestdbflutter","last_synced_at":"2026-01-11T04:05:37.149Z","repository":{"id":56828276,"uuid":"254420034","full_name":"p32929/EasiestdbFlutter","owner":"p32929","description":"The Easiest and the Laziest approach to Flutter SQL Database.","archived":false,"fork":false,"pushed_at":"2020-07-16T15:05:08.000Z","size":48,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T02:14:40.291Z","etag":null,"topics":["flutter","flutter-package","flutter-plugin","flutter-sqflite","flutter-sql","flutter-sqlite","flutterpackage","sql","sqlite","sqlite-database","sqlite3"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/easiestdb","language":"Dart","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":"CHANGELOG.md","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-04-09T16:12:25.000Z","updated_at":"2024-10-14T11:12:57.000Z","dependencies_parsed_at":"2022-08-28T21:10:16.303Z","dependency_job_id":null,"html_url":"https://github.com/p32929/EasiestdbFlutter","commit_stats":null,"previous_names":["p32929/easiestsqlflutter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestdbFlutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestdbFlutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestdbFlutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p32929%2FEasiestdbFlutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p32929","download_url":"https://codeload.github.com/p32929/EasiestdbFlutter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142903,"owners_count":21054671,"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":["flutter","flutter-package","flutter-plugin","flutter-sqflite","flutter-sql","flutter-sqlite","flutterpackage","sql","sqlite","sqlite-database","sqlite3"],"created_at":"2024-09-24T21:27:42.778Z","updated_at":"2026-01-11T04:05:37.093Z","avatar_url":"https://github.com/p32929.png","language":"Dart","readme":"![New Project](https://user-images.githubusercontent.com/6418354/87636772-0ce14100-c763-11ea-8d8b-0c7c36ae5ebe.png)\n\nThe Easiest and the Laziest approach to Flutter SQL Database for Flutter.\n\n • \u003ca href=\"#basic-usage\"\u003eHow to use\u003c/a\u003e •\n\u003ca href=\"#contribution\"\u003eContribution\u003c/a\u003e •\n\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e •\n\u003ca href=\"#support\"\u003eSupport\u003c/a\u003e •\n\n\n[![](https://badgen.net/github/watchers/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/stars/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/forks/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/issues/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/open-issues/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/closed-issues/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/label-issues/p32929/EasiestSqlFlutter/help-wanted/open)]() [![](https://badgen.net/github/prs/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/open-prs/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/closed-prs/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/merged-prs/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/commits/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/last-commit/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/branches/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/releases/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/tags/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/license/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/contributors/p32929/EasiestSqlFlutter)]() [![](https://badgen.net/github/dependents-pkg/p32929/EasiestSqlFlutter)]() \n\n[![](https://badgen.net/pub/v/easiestdb)]() [![](https://badgen.net/pub/likes/easiestdb)]() [![](https://badgen.net/pub/sdk-version/easiestdb)]() [![](https://badgen.net/pub/flutter-platform/easiestdb)]() \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://pub.dev/packages/easiestdb)\n[![twitter](https://image.flaticon.com/icons/png/32/124/124021.png)](https://twitter.com/intent/tweet?source=https://pub.dev/packages/easiestdb)\n[![tumblr](https://image.flaticon.com/icons/png/32/124/124012.png)](https://www.tumblr.com/share?v=3\u0026u=https://pub.dev/packages/easiestdb)\n[![pocket](https://image.flaticon.com/icons/png/32/732/732238.png)](https://getpocket.com/save?url=https://pub.dev/packages/easiestdb)\n[![pinterest](https://image.flaticon.com/icons/png/32/124/124039.png)](https://pinterest.com/pin/create/button/?url=https://pub.dev/packages/easiestdb)\n[![reddit](https://image.flaticon.com/icons/png/32/2111/2111589.png)](https://www.reddit.com/submit?url=https://pub.dev/packages/easiestdb)\n[![linkedin](https://image.flaticon.com/icons/png/32/1409/1409945.png)](https://www.linkedin.com/shareArticle?mini=true\u0026url=https://pub.dev/packages/easiestdb)\n[![whatsapp](https://image.flaticon.com/icons/png/32/733/733585.png)](https://api.whatsapp.com/send?text=https://pub.dev/packages/easiestdb)\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\ncheck out the [pub.dev](https://pub.dev/packages/easiestdb) for updated installation instructions\n\n## Basic Usage\nInit using Database name, Table names and Column names. After that, you can do all kinds of CRUD ( Create, Read, Update, Delete ) operations.\n\nAdd as many tables and columns you want using these simple codes.\n\n## Initialize the Database and the Tables\n###### `static Future\u003cDatabase\u003e init({ String dbName = 'demo.db', int version = 1, List\u003cDbTable\u003e tables })`\n###### `DbTable(String tableName, {List\u003cDbColumn\u003e dbColumns})`\n###### `DbColumn(String columnName, {String columnDataType = \" TEXT \"})`\n\nSuppose, we're trying to create a database of two tables named People and Test, each containing three columns.\nSo, we'll write:\n```\nEasiestDb.init(dbName: \"Data\", version: 1, dbTables: [\n    DbTable(\"People\", dbColumns: [\n      DbColumn('Col 1'), // Default data type is TEXT\n      DbColumn('Col 2'),\n    ]),\n    DbTable(\"Test\", dbColumns: [\n      DbColumn('Col 3'),\n      DbColumn('Col 4', columnDataType: \"TEXT UNIQUE\"),\n    ]),\n  ]);\n```\nLook carefully, we didn't add any `ID primary key` column. That's because `easiestdb` library does it by default for each table.\n\nAlso, you may add as many SQL Constrains in `columnDataType` parameter. By default, its set to ` TEXT `.\n\n## Add data\n###### `static Future\u003cint\u003e addData(int tableIndex, List\u003cDatum\u003e data)`\n###### `Datum(int columnIndex, String value)`\n\nAdd data in the 1st(0) table:\n\n```\nEasiestDb.addData(0, [\n    Datum(1, \"AAA\"),\n    Datum(2, \"123\"),\n]).then((id) {\n    print(\"ID: $id\");\n});\n```\n\nTo pass anything other than `string` in `addData` function, you can just convert them to String and pass it ( may be by using `yourValue.toString()` )\n\n## Get All data from a table\n###### `static Future\u003cList\u003cMap\u003cString, dynamic\u003e\u003e\u003e getAllData(int tableIndex, {bool ascending = true})`\n\nGet all data from the 1st(0) table ( all the indexes start from 0 )\n\n```\nEasiestDb.getAllData(0).then((listMap) {\n    listMap.forEach((map) {\n        print(\"${map.values.elementAt(0)}\"); // Showing the value of the ID column\n        print(\"${map.values.elementAt(1)}\"); // Showing the value from another column\n    });\n});\n```\n\n## Get one data\n###### `static Future\u003cList\u003cMap\u003cString, dynamic\u003e\u003e\u003e getOneRowData(int tableIndex, int rowId)`\n\nGet data from the 1st(0) table and the 7th(7) row ( all the indexes start from 0 but the rowId starts from 1 )\n\n```\nEasiestDb.getOneRowData(0, 7).then((listMap) {\n    listMap.forEach((map) {\n        print(\"${map.values.elementAt(0)}\"); // Showing the value of the ID column\n        print(\"${map.values.elementAt(1)}\"); // Showing the value from another column\n    });\n});\n```\n\n## Search data\n###### `static Future\u003cList\u003cMap\u003cString, dynamic\u003e\u003e\u003e getRowsByMatchingColumnData(int tableIndex, int columnIndex, var valueToMatch, {bool ascending = true})`\n\nSearching data in 1st(0) table in the 2nd(1) column by a value:\n\n```\nEasiestDb.getRowsByMatchingColumnData(0, 1, 'AAA').then((listMap) {\n    listMap.forEach((map) {\n        print(\"${map.values.elementAt(0)}\"); // Showing the value of the ID column\n        print(\"${map.values.elementAt(1)}\"); // Showing the value from another column\n    });\n});\n```\n\n## Update data in a row\n###### `static Future\u003cint\u003e updateOneDataById(int tableIndex, int rowId, List\u003cDatum\u003e data)`\n###### `Datum(int columnIndex, String value)`\n\nUpdate data in the first table (0), 7th(7) row:\n\n```\nEasiestDb.updateOneDataById(0, 7, [\n    Datum(1, \"F F F F F F \"),\n    Datum(2, \"G G G G G G \"),\n]).then((count) {\n    print(\"Count: $count\");\n});\n```\n\n## Delete one row data\n###### `static Future\u003cint\u003e deleteOneData(int tableIndex, int rowId)`\n\nDelete the 7th(7) row from the 1st(0) table:\n\n```\nEasiestDb.deleteOneData(0, 7).then((val) {\n    print(\"Count: $val\");\n});\n```\n\n## Delete a row if value matches in a column\n###### `static Future\u003cint\u003e deleteDataBySearchingInColumn(int tableIndex, Datum datum)`\n###### `Datum(int columnIndex, String value)`\n\nDelete a one/more data from the first table if matches value in the 2nd(1) column:\n\n```\nEasiestDb.deleteDataBySearchingInColumn(0, Datum(\n    1, \"F F F F F F \"\n)).then((val) {\n    print(\"Count: $val\");\n});\n```\n\n## Delete all data from a table\n###### `static void deleteTable(int tableIndex)`\n\nDelete/Drop the 2nd(1) table:\n\n```\nEasiestDb.deleteTable(1);\n```\n\n## Delete the all data from the database\n###### `static void deleteDatabase()`\n\nDelete/Drop the whole database:\n\n```\nEasiestDb.deleteDatabase();\n```\n\n## Run custom SQL commands\n###### `static Database getDatabaseObject()`\n\nAnd last but not the least, if you're trying to do something but there's no a function/method created for that command, you can always get the database object and run any custom command like below:\n\n```\nEasiestDb.getDatabaseObject().execute(sqlCommand)\n```\n\nBut if you really want that function implemented in `easiestdb` library, you can: \n1. fork the repo\n2. create a new branch by your `github username`\n3. add the code\n4. commit + push\n5. make a pull request.\n\nYou're welcome...\n\n## License\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```\n\n## Contribution\nLastly, I wanna thank the Flutter team for the amazing framework and [tekartik](https://github.com/tekartik/) for the sqflite library.\nAnd thanks to everyone for using `easiestdb` and thanks in advance to everyone for contributing...\n\nAlso, you might wanna try the Android/Java version of this library from here: https://github.com/p32929/EasiestSqlLibrary","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp32929%2Feasiestdbflutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp32929%2Feasiestdbflutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp32929%2Feasiestdbflutter/lists"}