Skip to content

Commit

Permalink
Fix a crash on fuzzy search.
Browse files Browse the repository at this point in the history
Update readme and changelog.
  • Loading branch information
Bojan committed Apr 25, 2021
1 parent 7280f7d commit 4a01dc7
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Changelog
=========

## Version 5.3.2

_2021-04-26_

* Fix crash on editor history.

## Version 5.3.1

_2021-04-25_

* Remove Timber dependency.
* Implement an optional logger.
* Update dependencies to more stable releases.

## Version 5.3.0

_2021-04-10_
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ With this library you can:
* drop view or trigger
* search table, view or trigger
* sort table, view or trigger per column
* execute any valid SQL command in editor per database connection

## Getting started
To include _DbInspector_ in your project, you have to add buildscript dependencies in your project level `build.gradle` or `build.gradle.kts`:
Expand All @@ -43,13 +44,13 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle.

**Groovy**
```groovy
debugImplementation "com.infinum.dbinspector:dbinspector:5.3.0"
releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.3.0"
debugImplementation "com.infinum.dbinspector:dbinspector:5.3.2"
releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.3.2"
```
**KotlinDSL**
```kotlin
debugImplementation("com.infinum.dbinspector:dbinspector:5.3.0")
releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.3.0")
debugImplementation("com.infinum.dbinspector:dbinspector:5.3.2")
releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.3.2")
```

### Usage
Expand Down Expand Up @@ -78,6 +79,25 @@ If you use _DbInspector_ for a specific flavor and need to override merged in la
Please do mind and copy over the suppression comment line too, if you need it.
Further modification can be done according to rules of [manifest merging](https://developer.android.com/studio/build/manifest-merge) and attributes of [activity-alias](https://developer.android.com/guide/topics/manifest/activity-alias-element) XML node.

## Editor

![Editor](editor.png)

_DbInspector_ has a build in editor scoped per database connection currently used.
It offers autocomplete of SQLite3 keywords and functions, current table and column names.
Built in editor also provides a history of executed statements, not matter if they were successful or not.
Hisotry of statements is persisted between sessions and can be cleared on demand at any point.
Panes between editors' input and result are scalable and can be adjusted by dragging the splitter between them.
Landscape mode is supported too for better result preview of large datasets.

## Logging
_DbInspector_ provides a independent and built in logger mechanism. Per default logger is initiated as an `EmptyLogger` omitting any output whatsoever.
In case logs output is required, `AndroidLogger` should be used as shown below:
```kotlin
DbInspector.show(logger = AndroidLogger())
```
Additionally, `AndroidLogger` uses `Level` to filter out between info, debug, error or no messages at all.

## Requirements
Minimum required API level to use _DbInspector_ is **21** known as [Android 5.0, Lollipop](https://www.android.com/versions/lollipop-5-0/).
As of 4.0.0 version, AndroidX is required. If you cannot unfortunately migrate your project, keep the previous version until you get the opportunity to migrate to AndroidX.
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build.debug=true
build.debug=false
4 changes: 2 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
]
releaseConfig = [
"group" : "com.infinum.dbinspector",
"version" : "5.3.0",
"versionCode": 5 * 100 * 100 + 3 * 100 + 0
"version" : "5.3.2",
"versionCode": 5 * 100 * 100 + 3 * 100 + 2
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("UNUSED_PARAMETER")

package com.infinum.dbinspector

import com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ internal class GetExecutionInteractor(
dataStore.current()
.executionsList
.filter { it.databasePath == input.execution?.databasePath }
.let { entities ->
.takeIf { it.isNotEmpty() }
?.let { entities ->
FuzzySearch.extractOne(
input.execution?.execution.orEmpty(),
entities.map { it.execution }
Expand Down
Binary file added editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[versions]
dbinspector = "5.3.0"
dbinspector = "5.3.2"
gradle = "4.1.3"
kotlin = "1.4.32"
coroutines = "1.4.3"
core = "1.3.2"
appcompat = "1.2.0"
activity = "1.2.2"
fragment = "1.3.2"
fragment = "1.3.3"
lifecycle = "2.3.1"
viewpager = "1.0.0"
paging = "3.0.0-beta03"
paging = "3.0.0-rc01"
recyclerview = "1.2.0"
startup = "1.0.0"
swiperefresh = "1.1.0"
datastore = "1.0.0-alpha08"
datastore = "1.0.0-beta01"
dynamicanimation = "1.0.0"
design = "1.3.0"
protobuf-core = "3.15.8"
protobuf-plugin = "0.8.15"
koin = "3.0.1-beta-2"
protobuf-plugin = "0.8.16"
koin = "3.0.1"
fuzzy = "1.3.1"
detekt = "1.16.0"
ktlint = "10.0.0"
Expand Down
Binary file removed screenshots.png
Binary file not shown.

0 comments on commit 4a01dc7

Please sign in to comment.