Skip to content

Commit

Permalink
Version 0.9.0-beta9
Browse files Browse the repository at this point in the history
  • Loading branch information
luposlip committed Feb 7, 2024
1 parent b69f287 commit 15c89e0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ All notable changes to this project will be documented in this file. This change
- Timestamps for historical versions
- Optimize (speed+size of) low level index format

## [0.9.0-beta9] - 2024-02-07

### Enhanced

- Specific error message when serialized nippy cannot be read (probably because
of nippy versioning discrepancies)

### Updated

- nippy library updated from 3.2.0 to 3.3.0
- cheshire and commons-compress also updated

## [0.9.0-beta8] - 2023-10-04

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# nd-db

```clojure
[com.luposlip/nd-db "0.9.0-beta8"]
[com.luposlip/nd-db "0.9.0-beta9"]
```

_Newline Delimited (read-only) Databases!_
Expand Down
8 changes: 4 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(defproject com.luposlip/nd-db "0.9.0-beta8"
(defproject com.luposlip/nd-db "0.9.0-beta9"
:description "Clojure library to use newline delimited files as fast read-only databases."
:url "https://github.com/luposlip/nd-db"
:license {:name "Apache License, Version 2.0"
:url "https://www.apache.org/licenses/LICENSE-2.0"}
:dependencies [[org.clojure/clojure "1.11.1"]
[com.taoensso/nippy "3.2.0"]
[org.apache.commons/commons-compress "1.24.0"]
[com.taoensso/nippy "3.3.0"]
[org.apache.commons/commons-compress "1.25.0"]
[digest "1.4.10"]
[cheshire "5.11.0"]]
[cheshire "5.12.0"]]
:global-vars {*warn-on-reflection* true}
:repl-options {:init-ns nd-db.core})
12 changes: 11 additions & 1 deletion src/nd_db/io.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
[io :as ndio]
[id-fns :as ndid]
[csv :as ndcs]])
(:import [java.io File Writer FileWriter BufferedWriter
(:import [clojure.lang ExceptionInfo]
[java.io File Writer FileWriter BufferedWriter
RandomAccessFile]))

(defn tmpdir []
Expand Down Expand Up @@ -147,6 +148,15 @@
:doc-parser (params->doc-parser params)
:doc-emitter (params->doc-emitter params))
(maybe-update-filename filename))))

(catch ExceptionInfo e
(if (-> e ex-message (str/includes "Thaw"))
(throw (ex-info "Unable to read nippy, db created with newer version?"
{:nippy-meta (ex-data e)
:filename filename
:serialized-filename serialized-filename
:meta meta}))
(throw e)))
(catch Exception e
(when (or (-> e ex-message (str/includes? "String.getBytes"))
(str/includes? (ex-message e) "base64"))
Expand Down

0 comments on commit 15c89e0

Please sign in to comment.