Skip to content

Commit

Permalink
fix issue#386 Android comment in SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
jepiqueau committed Mar 10, 2023
1 parent d5db37c commit 1462f59
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 4.6.3-3 (2023-03-10)

### Bug Fixes

- Fix Strip comment lines when using CapacitorSQLite.execute (Android} PR#387 by patdx
- Fix CapacitorSQLite.execute on Android does not support comments issue#386
- Add Comments within SQL statements in API.md

# 4.6.3-2 (2023-03-10)

### Bug Fixes
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/dw/@capacitor-community/sqlite?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/v/@capacitor-community/sqlite?style=flat-square" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-30-orange?style=flat-square" /></a>
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-31-orange?style=flat-square" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
</p>

Expand Down Expand Up @@ -345,6 +345,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<a href="https://github.com/Micha-Richter" title="Micha-Richter"><img src="https://github.com/Micha-Richter.png?size=100" width="50" height="50" /></a>
<a href="https://github.com/ws-rush" title="ws-rush"><img src="https://github.com/ws-rush.png?size=100" width="50" height="50" /></a>
<a href="https://github.com/eppineda" title="eppineda"><img src="https://github.com/eppineda.png?size=100" width="50" height="50" /></a>
<a href="https://github.com/patdx" title="patdx"><img src="https://github.com/patdx.png?size=100" width="50" height="50" /></a>
</p>


Expand Down
Binary file modified android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ public String[] getStatementsArray(String statements) {
StringBuilder builder = new StringBuilder();
for (String s : array) {
String line = s.trim();
if (line.startsWith("--")) {
// is a comment, do nothing
} else if (s.length() > 0) {
int idx = line.indexOf("--");
if(idx > -1) {
line = line.substring(0, idx);
}
if(line.length() > 0) {
if (builder.length() > 0) {
builder.append(" ");
}
builder.append(s);
builder.append(line);
}

}
Expand Down
4 changes: 4 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ The plugin add a suffix "SQLite" and an extension ".db" to the database name giv
- the database is stored in Web browser INDEXEDDB storage as a `localforage` store under the `jeepSqliteStore` name and `databases` table name.
## Comments within SQL statements
- see [Comments within SQL](https://www.techonthenet.com/sqlite/comments.php)
## Write-Ahead Logging (WAL)
- Electron, Web platforms only WAL journal_mode is implemented
Expand Down

0 comments on commit 1462f59

Please sign in to comment.