All Projects → xsc → Claro

xsc / Claro

Licence: mit
Powerful Data Access for Clojure

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Claro

Ts Proto
An idiomatic protobuf generator for TypeScript
Stars: ✭ 340 (+150%)
Mutual labels:  dataloader
Typeorm Graphql Loader
A query builder to easily resolve nested fields and relations for TypeORM-based GraphQL servers
Stars: ✭ 47 (-65.44%)
Mutual labels:  dataloader
Superlifter
A DataLoader for Clojure/script
Stars: ✭ 102 (-25%)
Mutual labels:  dataloader
Graphql Dataloader Boilerplate
Very simple boilerplate using GraphQL and DataLoader
Stars: ✭ 405 (+197.79%)
Mutual labels:  dataloader
Batch Loader
⚡️ Powerful tool for avoiding N+1 DB or HTTP queries
Stars: ✭ 812 (+497.06%)
Mutual labels:  dataloader
Type Graphql Dataloader
TypeGraphQL + DataLoader + TypeORM made easy
Stars: ✭ 73 (-46.32%)
Mutual labels:  dataloader
pymia
pymia: A Python package for data handling and evaluation in deep learning-based medical image analysis
Stars: ✭ 46 (-66.18%)
Mutual labels:  dataloader
Dataloader
DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
Stars: ✭ 11,040 (+8017.65%)
Mutual labels:  dataloader
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-79.41%)
Mutual labels:  dataloader
Nestjs Dataloader
Dataloader plugin for NestJS
Stars: ✭ 97 (-28.68%)
Mutual labels:  dataloader
Mobilepose Pytorch
Light-weight Single Person Pose Estimator
Stars: ✭ 427 (+213.97%)
Mutual labels:  dataloader
Dataloader
Implementation of Facebook's DataLoader in Golang
Stars: ✭ 703 (+416.91%)
Mutual labels:  dataloader
Video Dataset Loading Pytorch
Generic PyTorch Dataset Implementation for Loading, Preprocessing and Augmenting Video Datasets
Stars: ✭ 92 (-32.35%)
Mutual labels:  dataloader
Java Dataloader
A Java 8 port of Facebook DataLoader
Stars: ✭ 367 (+169.85%)
Mutual labels:  dataloader
Nestjs Example
NestJS example with GraphQL, Schema-Stitching, Dataloader, GraphQL Upload, RabbitMQ, Redis, Scalable Websocket and JWT authentication
Stars: ✭ 111 (-18.38%)
Mutual labels:  dataloader
http-link-dataloader
📚📡 HTTP Apollo Link with batching & caching provided by dataloader.
Stars: ✭ 80 (-41.18%)
Mutual labels:  dataloader
Redis Dataloader
Batching and Caching layer using Redis as the Caching layer
Stars: ✭ 72 (-47.06%)
Mutual labels:  dataloader
Continuum
A clean and simple data loading library for Continual Learning
Stars: ✭ 136 (+0%)
Mutual labels:  dataloader
Q42.winrt
Useful library for data driven Windows Phone 8 and Windows 8 C# / XAML WinRT projects
Stars: ✭ 111 (-18.38%)
Mutual labels:  dataloader
Dataloaders
Pytorch and TensorFlow data loaders for several audio datasets
Stars: ✭ 97 (-28.68%)
Mutual labels:  dataloader

claro

Documentation | Guides

claro is a library that allows you to streamline your data access, providing powerful optimisations and abstractions along the way.

Build Status Clojars Artifact codecov

It is inspired by muse and heavily influenced by GraphQL.

claro requires Clojure ≥ 1.7.0.

Features

claro is designed to be flexible and extensible. It'll make your data access more elegant, efficient and testable, providing things like:

  • batched resolution of similar entities,
  • automatic caching of already known resolution results,
  • engine middlewares to hook into the resolution logic, allowing e.g. generic cache or circuit breaker implementations,
  • pluggable resolution strategies in the form of Resolvable selectors,
  • an exchangeable deferred implementation, defaulting to manifold,
  • and pre-built middlewares for data source mocking, introspection and result transformation.

Quickstart

Data access is defined within records implementing the Resolvable interface. Note that they can always produce more resolvables:

(require '[claro.data :as data]
         '[manifold.deferred :as d])

(defrecord Person [id]
  data/Resolvable
  (resolve! [_ env]
    (d/future
      (fetch-person! (:db env) id)))
  data/Transform
  (transform [_ {:keys [friend-ids] :as person}]
    (assoc person :friends (map #(Person. %) friend-ids))))

Blindly resolving an infinite tree like this is usually not a good idea – but claro offers tree projections you can use to describe abstract transformations of infinite structures:

(require '[claro.projection :as projection])

(def person-with-friend-names
  {:id      projection/leaf
   :name    projection/leaf
   :friends [(projection/extract :name)]})

And here we go:

(require '[claro.engine :as engine])

(engine/run!!
  (-> (->Person 1)
      (projection/apply person-with-friend-names)))
;; => {:id 1, :name "Sherlock Holmes", :friends ["Dr. Watson", "Ms. Hudson"]}

Related Projects

Library Description
alumbra GraphQL implementation on top of claro
claro.circuit-breaker Circuit-breaker middleware based on resilience4j

Feel free to open a pull request to add your project to this table.

Documentation

  1. Basic Resolution
  2. Projections
  3. Advanced Projections
  4. Engine
  5. Testing & Debugging
  6. Implementation Notes

All these topics are also available in claro's auto-generated documentation.

Contributing

Contributions are always welcome. Please take a look at the Contribution Guidelines for a quick overview of how your changes can best make it to master.

License

MIT License

Copyright (c) 2015-2017 Yannick Scherer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].