-
Notifications
You must be signed in to change notification settings - Fork 434
Make the database portable and encryptable (#3848) #5526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shai-almog
wants to merge
35
commits into
master
Choose a base branch
from
feature/portable-encryptable-database
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
5b0f0b0
Define the portable Database contract and add the encryption API
shai-almog a29da0d
Make the simulator conformant and able to open encrypted databases
shai-almog 85f6127
Make the iOS database conformant and fix three defects in it
shai-almog 0fedd67
Bring Android to the database contract and add encrypted databases
shai-almog b0e2de8
Give the native Windows and Linux ports a database
shai-almog dcf1f1f
Replace WebSQL with SQLite on WebAssembly and gate the engine per app
shai-almog ce77b83
Add device conformance tests, documentation and the interop proof
shai-almog 70dc81f
Fix the three CI failures from the first run
shai-almog d595bd9
Exclude the SQLCipher package from the Ant Android build too
shai-almog 7f2f2c7
Address the review findings and the second round of CI failures
shai-almog 766ab43
Address the second batch of review findings
shai-almog 1b78be8
Address the third batch of review findings
shai-almog c8ca4a5
Satisfy the forbidden PMD rules
shai-almog dbcceec
Compile the engine's ciphers without assuming CPU features are enabled
shai-almog ba13354
Add copyright headers to the new guide snippet files
shai-almog ecad03f
Address the fourth review batch, the guide prose gate and CodeQL noise
shai-almog efbab6c
Fix failed-commit recovery, parameter counts and the JS key probe
shai-almog f5767b0
Report unbound parameters from executeQuery(String) with the shared m…
shai-almog e282819
Default Ant projects to database compatibility mode
shai-almog 730a69a
Roll back through the engine when an Android commit fails
shai-almog cb0456a
Close out the fourth review round
shai-almog c6f57d4
Make Android encryption buildable, and actually exercise it
shai-almog 452c6cf
Make encrypt and decrypt work on Android
shai-almog 952f337
Stop the JavaScript port hanging when the SQLite engine will not start
shai-almog 7a70937
Do not assert a filesystem path where databases are not filesystem ba…
shai-almog 62e2271
Close out the fifth review round
shai-almog 4a11dc9
Stop every JavaScript native binding from throwing across the bridge
shai-almog d4d3c89
Fix three ways the previous round's fixes could fail
shai-almog 483acb2
Complete the migration recovery, and stop OPFS trouble losing data
shai-almog 81cbb36
Type-check the SQLCipher package, which nothing else compiles
shai-almog 4c32755
Close the remaining native and dispatch error paths
shai-almog 13cef92
Resolve the cipher check's dependencies from the reactor, not a repos…
shai-almog 2b527c3
Sweep the error paths I had fixed in only one implementation
shai-almog ce68bdd
Fix three defects the previous round's fixes introduced or left
shai-almog 79aceb2
Move migration artifacts out of the database namespace entirely
shai-almog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Vendored third-party sources. Marking them keeps them out of language | ||
| # statistics and collapses them in diffs, so a routine engine update does not | ||
| # read as a 400,000 line change and does not push review tooling past its | ||
| # size limits. | ||
| vm/ByteCodeTranslator/src/cn1_sqlite3_amalgamation.h linguist-vendored linguist-generated -diff | ||
| vm/ByteCodeTranslator/src/cn1_sqlite3.h linguist-vendored linguist-generated -diff | ||
| Ports/JavaScriptPort/src/main/webapp/js/sqlite3mc.js linguist-vendored -diff | ||
| Ports/JavaScriptPort/src/main/webapp/js/sqlite3-opfs-async-proxy.js linguist-vendored -diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /* | ||
| * Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. Codename One designates this | ||
| * particular file as subject to the "Classpath" exception as provided | ||
| * by Oracle in the LICENSE file that accompanied this code. | ||
| * | ||
| * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| * version 2 for more details (a copy is included in the LICENSE file that | ||
| * accompanied this code). | ||
| * | ||
| * You should have received a copy of the GNU General Public License version | ||
| * 2 along with this work; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| * | ||
| * Please contact Codename One through http://www.codenameone.com/ if you | ||
| * need additional information or have any questions. | ||
| */ | ||
| package com.codename1.db; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| /// Optional cursor capabilities, in the same spirit as `RowExt`. | ||
| /// | ||
| /// These are not on `Cursor` itself because that interface is public and is | ||
| /// implemented outside this repository; adding a method to it would break every | ||
| /// third party library that provides one. Reach these through the static helpers | ||
| /// on `Database`, which degrade gracefully on a cursor that does not implement | ||
| /// this interface: | ||
| /// | ||
| /// ```java | ||
| /// Database.beforeFirst(cursor); | ||
| /// int rows = Database.count(cursor); // -1 when the port cannot say cheaply | ||
| /// ``` | ||
| /// | ||
| /// Every cursor returned by a Codename One port implements this. | ||
| public interface CursorExt extends Cursor { | ||
|
|
||
| /// Rewinds to before the first row, without landing on a row. | ||
| /// | ||
| /// After this call `Cursor#getPosition()` reports -1 and `Cursor#getRow()` | ||
| /// throws, exactly as on a freshly returned cursor. This is the operation | ||
| /// `Cursor#position(int)` performs when given -1. | ||
| /// | ||
| /// #### Throws | ||
| /// | ||
| /// - `IOException`: if the cursor is closed or the rewind fails | ||
| void beforeFirst() throws IOException; | ||
|
|
||
| /// Returns the number of rows in the result set, or -1 when the port cannot | ||
| /// determine it without walking the whole set. | ||
| /// | ||
| /// Ports that already track the count report it directly. Ports backed by a | ||
| /// forward-only statement have to step to the end and rewind, so they report | ||
| /// the count once it is known and -1 before that. Treat -1 as "unknown", not | ||
| /// as "empty". | ||
| /// | ||
| /// #### Returns | ||
| /// | ||
| /// the row count, or -1 when it is not cheaply available | ||
| /// | ||
| /// #### Throws | ||
| /// | ||
| /// - `IOException`: if the cursor is closed | ||
| int getCount() throws IOException; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.