Skip to content

Commit

Permalink
Prepare 2.0.0-1.7.2-0-alpha01 release
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Oct 13, 2023
1 parent 8cbd254 commit fd79796
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 50 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CHANGELOG

## Version 2.0.0-1.7.2-0-alpha01 (2023-10-13)
- Initial `alpha` release
91 changes: 43 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
An [SQLDelight][url-sqldelight] driver that uses [SQLite3MultipleCiphers][url-sqlitemc] for
database encryption.



### Usage

- Define `DatabasesDir`
Expand Down Expand Up @@ -89,7 +87,7 @@ database encryption.
put("busy_timeout", 3_000.toString())

// ephemeral connections only
ephemeral.put("secure_delete", "false")
ephemeral.put("secure_delete", false.toString())

// filesystem connections only
filesystem.put("secure_delete", "fast")
Expand Down Expand Up @@ -118,6 +116,7 @@ database encryption.

- Easily spin up an ephemeral database for your configuration (no encryption)
```kotlin
// NOTE: Suspension function "create" alternative available
val inMemoryDriver = factory.createBlocking(opt = EphemeralOpt.IN_MEMORY)
val namedDriver = factory.createBlocking(opt = EphemeralOpt.NAMED)
val tempDriver = factory.createBlocking(opt = EphemeralOpt.TEMPORARY)
Expand All @@ -129,17 +128,20 @@ database encryption.
- Easily change `Key`s
```kotlin
// NOTE: Suspension function "create" alternative available
val driver2 = factory.createBlocking(
key = Key.passphrase("password"),
rekey = Key.passphrase("new password"),
)
val driver2 = factory.createBlocking(key = Key.passphrase("password"), rekey = Key.passphrase("new password"))
driver2.close()

// Remove encryption entirely by passing an empty key (i.e. Key.passphrase(""))
val driver3 = factory.createBlocking(key = key.passphrase("new password"), rekey = Key.Empty)
driver3.close()

// Also supports use of RAW (already derived) keys and/or salt storage for SQLCipher & ChaCha20
val (derivedKey, salt) = deriveMy32ByteKeyAnd16ByteSalt("secret password") // however you want to do it
val salt = getOrCreate16ByteSalt("user abc")
val derivedKey = derive32ByteKey(salt, "user secret password input")
val rawKey = Key.raw(key = derivedKey, salt = salt, fillKey = true)

val driver3 = factory.createBlocking(key = Key.passphrase("new password"), rekey = rawKey)
val driver4 = factory.createBlocking(key = Key.Empty, rekey = rawKey)
driver4.close()
```

- Easily migrate encryption configurations between software releases by defining a migrations block
Expand All @@ -155,9 +157,9 @@ database encryption.

// Simply move your old encryption config up to a migration.
//
// Do note that if you _are_ migrating from SQLCipher library,
// the version of SQLCipher used the first time your app was
// published with it. You will _also_ need to define migrations
// If you _are_ migrating from SQLCipher library, note the
// version of SQLCipher used the first time your app was
// published with it. You will also need to define migrations
// all the way back for each possible version (v1, v2, v3),
// so that users who have not opened your app in a long time
// can migrate from those versions as well.
Expand Down Expand Up @@ -363,44 +365,37 @@ I'm guessing this is not really a factor on iOS."

<!-- TAG_VERSION -->

Currently, this library is still under heavy construction.

A `-SNAPSHOT` will be released in order to hone the API while
integrating it into some other projects I am building this for,
after which an `-alpha01` release will follow.

<!--
**Set `linkSqlite` to false**
```kotlin
sqldelight {
linkSqlite.set(false) // <<--- must be false if using native
databases {
// ...
}
}
```
**Add dependencies**
```kotlin
dependencies {
val sqliteMC = "2.0.0-1.6.4-0-SNAPSHOT"
// NOTE: Remove dependencies on the following if you have them
// - "app.cash.sqldelight:sqlite-driver"
// - "app.cash.sqldelight:native-driver"
implementation("io.toxicity.sqlite-mc:driver:$sqliteMC")
// For android unit tests (NOT instrumented)
// This is simply the desktop binary resources needed for JDBC
testImplementation("io.toxicity.sqlite-mc:android-unit-test:$sqliteMC")
}
```
-->
1. Remove `SQLDelight` gradle plugin and drivers from your project
2. Apply the `sqlite-mc` gradle plugin.
```kotlin
plugins {
// Provides the SQLDelight gradle plugin automatically and applies it
id("io.toxicity.sqlite-mc") version("2.0.0-1.7.2-0-alpha01")
}

// Will automatically:
// - Configure the latest SQLite dialect
// - Add the sqlite-mc driver dependency
// - Link native targets for provided SQLite3MultipleCiphers binaries
sqliteMC {
databases {
// Configure just like you would the SQLDelight plugin
}
}
```
3. If you have Android unit tests
```kotlin
dependencies {
// For android unit tests (NOT instrumented)
//
// This is simply the desktop binary resources needed for
// JDBC to operate locally on the machine.
testImplementation("io.toxicity.sqlite-mc:android-unit-test:2.0.0-1.7.2-0-alpha01")
}
```

<!-- TAG_VERSION -->
[badge-latest-release]: https://img.shields.io/badge/latest--release-2.0.0--1.7.2--0--SNAPSHOT-blue.svg?style=flat
[badge-latest-release]: https://img.shields.io/badge/latest--release-2.0.0--1.7.2--0--alpha01-blue.svg?style=flat
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_DEPENDENCIES -->
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ POM_DEVELOPER_ID=toxicity-io
POM_DEVELOPER_NAME=Toxicity
POM_DEVELOPER_URL=https://github.com/toxicity-io/

# first actual release will be -alpha01
VERSION_NAME=2.0.0-1.7.2-0-SNAPSHOT
VERSION_NAME=2.0.0-1.7.2-0-alpha01
# 2.0.0-1.6.4-0-alpha01 = (02 00 00 00) + (01 06 04 00) + 11 = 03 06 04 11
# 2.0.0-1.6.4-0-beta01 = (02 00 00 00) + (01 06 04 00) + 21 = 03 06 04 21
# 2.0.0-1.6.4-0-rc01 = (02 00 00 00) + (01 06 04 00) + 31 = 03 06 04 31
Expand Down

0 comments on commit fd79796

Please sign in to comment.