Created
April 28, 2012 14:50
-
-
Save stuarthalloway/2519604 to your computer and use it in GitHub Desktop.
Add database functions and bytes value types to Datomic
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
;; Builds of Datomic with revision numbers higher than 0.1.3057 have | |
;; support for :db.type/fn, :db.type/bytes, and :db/fn. | |
;; To add these types to a database created using with a pre-0.1.3057 | |
;; build, simply run the database with a newer version of Datomic, and | |
;; execute the two transactions below. | |
[{:db/id #db/id [:db.part/db] | |
:db/ident :db.type/bytes | |
:fressian/tag :bytes | |
:db/doc "Value type for small binaries. Maps to byte array on the JVM." | |
:db.install/_valueType :db.part/db} | |
{:db/id #db/id [:db.part/db] | |
:db/ident :db.type/fn | |
:fressian/tag :datomic/fn | |
:db/doc "Value type for database functions. See Javadoc for Peer.function." | |
:db.install/_valueType :db.part/db}] | |
[{:db/id #db/id [:db.part/db] | |
:db/ident :db/fn | |
:db/valueType :db.type/fn | |
:db/cardinality :db.cardinality/one | |
:db/doc "A function-valued attribute for direct use by transactions and queries." | |
:db.install/_attribute :db.part/db}] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment