lurodrigo / firestore-clj Goto Github PK
View Code? Open in Web Editor NEWAn unofficial Firestore API for Clojure. Provides tools for doing single pulls and writes, streaming real-time data, batched writes and transactions.
License: MIT License
An unofficial Firestore API for Clojure. Provides tools for doing single pulls and writes, streaming real-time data, batched writes and transactions.
License: MIT License
There seems to be a typo in the name of the function sort-by
- it should be order-by
in the README
file. I checked the source code and tested as well.
I'll formalize the emulator code in this issue: codestiff#1
Until then let me give you a quick run down.
The code here: #4
was designed to avoid needing the java process running your clojure to have the env variable, FIRESTORE_EMULATOR_HOST
Background:
Most of what I did is analyze the google cloud firestore client. Located here: https://github.com/googleapis/java-firestore
We can see where I found the idea for FakeCredentials
here: https://github.com/googleapis/java-firestore/blob/813e246f8ec5d25e8101480e3e21270160fdf2cc/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java#L264
Observations:
FIRESTORE_EMULATOR_HOST
It looks like one of the "necessary" (for some circumstances) steps before using firestore-clj
is to set managed-dependencies
. I'm not familiar with what is happening here but suffice it to say, I've been needing to do things like: https://github.com/codestiff/connective/blob/0.1.7/modules/connective-firestore/project.clj#L8
In order to work w/ firestore-clj
. I think a more complete picture of what is causing compilation issues when not using managed-dependencies
is worthwhile.
For example,
Caused by: java.lang.NoClassDefFoundError: io/grpc/ManagedChannel
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3144)
at java.base/java.lang.Class.getMethods(Class.java:1863)
at clojure.lang.Reflector.getMethods(Reflector.java:498)
at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:994)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
... 196 more
Caused by: java.lang.ClassNotFoundException: io.grpc.ManagedChannel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 203 more
Subprocess failed
REPL server launch timed out.
Hi,
Suddenly I started getting the following error in the case of create (add!) and update (merge!) calls:
Execution error (NoSuchMethodError) at com.google.firestore.v1.Document/writeTo (Document.java:480). com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(Lcom/google/protobuf/CodedOutputStream;Lcom/google/protobuf/MapField;Lcom/google/protobuf/MapEntry;I)V
A quick search indicates that there are potentially version issues wrt gRPC/Protobuff. But it is surprising because, the same operations were fine a day ago.
I am wondering if you also have come across the same issue? I tried some deps exclusions, but it hasn't worked yet.
This is a wonderful contribution. I want to use it in the Firestore version of my Datastore library for AppEngine. In that library I'm using the AppEngine test doubles for Datastore but there is no such thing for Firestore. Only the emulator. How do you write good tests with this thing?
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.