Skip to content

Commit 4a01dc7

Browse files
author
Bojan
committed
Fix a crash on fuzzy search.
Update readme and changelog.
1 parent 7280f7d commit 4a01dc7

File tree

9 files changed

+51
-14
lines changed

9 files changed

+51
-14
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Changelog
22
=========
33

4+
## Version 5.3.2
5+
6+
_2021-04-26_
7+
8+
* Fix crash on editor history.
9+
10+
## Version 5.3.1
11+
12+
_2021-04-25_
13+
14+
* Remove Timber dependency.
15+
* Implement an optional logger.
16+
* Update dependencies to more stable releases.
17+
418
## Version 5.3.0
519

620
_2021-04-10_

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ With this library you can:
1818
* drop view or trigger
1919
* search table, view or trigger
2020
* sort table, view or trigger per column
21+
* execute any valid SQL command in editor per database connection
2122

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

4445
**Groovy**
4546
```groovy
46-
debugImplementation "com.infinum.dbinspector:dbinspector:5.3.0"
47-
releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.3.0"
47+
debugImplementation "com.infinum.dbinspector:dbinspector:5.3.2"
48+
releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.3.2"
4849
```
4950
**KotlinDSL**
5051
```kotlin
51-
debugImplementation("com.infinum.dbinspector:dbinspector:5.3.0")
52-
releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.3.0")
52+
debugImplementation("com.infinum.dbinspector:dbinspector:5.3.2")
53+
releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.3.2")
5354
```
5455

5556
### Usage
@@ -78,6 +79,25 @@ If you use _DbInspector_ for a specific flavor and need to override merged in la
7879
Please do mind and copy over the suppression comment line too, if you need it.
7980
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.
8081

82+
## Editor
83+
84+
![Editor](editor.png)
85+
86+
_DbInspector_ has a build in editor scoped per database connection currently used.
87+
It offers autocomplete of SQLite3 keywords and functions, current table and column names.
88+
Built in editor also provides a history of executed statements, not matter if they were successful or not.
89+
Hisotry of statements is persisted between sessions and can be cleared on demand at any point.
90+
Panes between editors' input and result are scalable and can be adjusted by dragging the splitter between them.
91+
Landscape mode is supported too for better result preview of large datasets.
92+
93+
## Logging
94+
_DbInspector_ provides a independent and built in logger mechanism. Per default logger is initiated as an `EmptyLogger` omitting any output whatsoever.
95+
In case logs output is required, `AndroidLogger` should be used as shown below:
96+
```kotlin
97+
DbInspector.show(logger = AndroidLogger())
98+
```
99+
Additionally, `AndroidLogger` uses `Level` to filter out between info, debug, error or no messages at all.
100+
81101
## Requirements
82102
Minimum required API level to use _DbInspector_ is **21** known as [Android 5.0, Lollipop](https://www.android.com/versions/lollipop-5-0/).
83103
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.

build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build.debug=true
1+
build.debug=false

config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ext {
77
]
88
releaseConfig = [
99
"group" : "com.infinum.dbinspector",
10-
"version" : "5.3.0",
11-
"versionCode": 5 * 100 * 100 + 3 * 100 + 0
10+
"version" : "5.3.2",
11+
"versionCode": 5 * 100 * 100 + 3 * 100 + 2
1212
]
1313
}

dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("UNUSED_PARAMETER")
2+
13
package com.infinum.dbinspector
24

35
import com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/history/interactors/GetExecutionInteractor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ internal class GetExecutionInteractor(
1414
dataStore.current()
1515
.executionsList
1616
.filter { it.databasePath == input.execution?.databasePath }
17-
.let { entities ->
17+
.takeIf { it.isNotEmpty() }
18+
?.let { entities ->
1819
FuzzySearch.extractOne(
1920
input.execution?.execution.orEmpty(),
2021
entities.map { it.execution }

editor.png

299 KB
Loading

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[versions]
2-
dbinspector = "5.3.0"
2+
dbinspector = "5.3.2"
33
gradle = "4.1.3"
44
kotlin = "1.4.32"
55
coroutines = "1.4.3"
66
core = "1.3.2"
77
appcompat = "1.2.0"
88
activity = "1.2.2"
9-
fragment = "1.3.2"
9+
fragment = "1.3.3"
1010
lifecycle = "2.3.1"
1111
viewpager = "1.0.0"
12-
paging = "3.0.0-beta03"
12+
paging = "3.0.0-rc01"
1313
recyclerview = "1.2.0"
1414
startup = "1.0.0"
1515
swiperefresh = "1.1.0"
16-
datastore = "1.0.0-alpha08"
16+
datastore = "1.0.0-beta01"
1717
dynamicanimation = "1.0.0"
1818
design = "1.3.0"
1919
protobuf-core = "3.15.8"
20-
protobuf-plugin = "0.8.15"
21-
koin = "3.0.1-beta-2"
20+
protobuf-plugin = "0.8.16"
21+
koin = "3.0.1"
2222
fuzzy = "1.3.1"
2323
detekt = "1.16.0"
2424
ktlint = "10.0.0"

screenshots.png

-283 KB
Binary file not shown.

0 commit comments

Comments
 (0)