davesann / cljs-uuid Goto Github PK
View Code? Open in Web Editor NEWmicro cljs uuid lib
micro cljs uuid lib
I have a duplicate UUID key while testing for insertion in a db table.
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "users_pkey" Detail: Key (id)=(6b540cda-ba85-464e-9c68-72235f1452fa) already exists.
The UUID key above was generated using cljs-uuid.core/make-random
. The similar inserted key in the table is the only key in the table. The already inserted UUID was generated with uuid_generate_v4()
function from uuid-ossp module in postgresql.
I think this problem problem occurred after upgrading to the latest version of cljs-uuid from an older version of the same library.
Using:
[cljs-uuid "0.0.4"]
Mac OS X 10.6.8
Hi Dave,
I needed a random-uuid generator that works with the current clojurescript version.
Your current version didn't work with the updated cljs-version as of 11/27/12...
I took the liberty to copy part of your code to make it work (thanks!):
https://gist.github.com/4159427
As cljs.core/UUID defines a deftype with interface implementations, much of the pr-str and read-string can be left to the cljs.core/UUID implementation.
A random UUID generator for cljs will benefit the cljs-community!
If you will update your version, I'd be happy to use yours in the future.
If not, I will (reluctantly) maintain my version and make it available via github/clojars.
Thank, FrankS.
The Clojure side can read either #<UUID ...>
or #uuid "..."
. The Clojurescript can only read the #uuid "..."
syntax.
There should either be a way to print UUIDs on the Clojure side in the cljs-readable syntax OR the Clojurescript side should be able to read both syntaxes.
WARNING: Wrong number of args (1) passed to UUID at line 16 file:/Volumes/DataRAID/Users/sean/.m2/repository/cljs-uuid/cljs-uuid/0.0.4/cljs-uuid-0.0.4.jar!/cljs_uuid/core.cljs
I'm using:
[cljs-uuid "0.0.4"]
and
[org.clojure/clojurescript "0.0-3308"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.