From 746aee9064da1190b48470cc0c32ee66adc7a8ca Mon Sep 17 00:00:00 2001 From: Kang Cahya Date: Tue, 21 May 2024 11:44:00 +0700 Subject: [PATCH] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a683468..810accb 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,15 @@ Before you using this helper, you must be install plugin [nativescript-community ## Instructions 1. Download file [sqlite_helper.js](https://github.com/dyazincahya/sqlite-helper-nativescript/blob/main/sqlite_helper.js) and save that file here : ```\YOUR_NATIVESCRIPT_PROJECT\app``` -2. In the ```sqlite_helper.js``` file, find ```openOrCreate("your_database.db")``` code and change with your database name -3. Then put the ```your_database.db``` on ```\YOUR_NATIVESCRIPT_PROJECT\app``` -4. In the ```sqlite_helper.js``` file, find ```showError``` variable then set it to ```true``` if you want to see all errors that occur during development on your sqlite -5. import file sql_helper.js on your module, like : +2. Create ```.db``` file using [SQLite Browser](https://sqlitebrowser.org) +3. And after that put the ```your_database.db``` in ```\YOUR_NATIVESCRIPT_PROJECT\app``` +4. Then in the ```sqlite_helper.js``` file, find ```openOrCreate("your_database.db")``` code and change with your database name. +5. Still in the ```sqlite_helper.js``` file, find ```showError``` variable then set it to ```true``` if you want to see all errors that occur during development on your sqlite. +6. import file sql_helper.js on your module, like : ``` javascript import { SQL__select, SQL__selectRaw, SQL__insert, SQL__update, SQL__delete, SQL__truncate, SQL__query } from "~/sqlite_helper"; ``` -6. Avaliable methode on ```sql_helper.js``` +7. Avaliable methode on ```sql_helper.js``` | Method | Description | Return | |-------------------|-------------------------------------------------------------|--------| | SQL__select(...) | for get data from table | Array | @@ -30,7 +31,7 @@ Before you using this helper, you must be install plugin [nativescript-community | SQL__delete(...) | for delete data row from table | void | | SQL__truncate(...) | for clear all data on the table | void | | SQL__query(...) | for execute raw query like Create new Table or Etc | ? | -7. For details, you can look at the [sqlite_helper.js](https://github.com/dyazincahya/sqlite-helper-nativescript/blob/main/sqlite_helper.js) file directly +8. For details, you can look at the [sqlite_helper.js](https://github.com/dyazincahya/sqlite-helper-nativescript/blob/main/sqlite_helper.js) file directly ## Sample Code