pdg-core

Microservice query language for Java

License

License

GroupId

GroupId

com.b2wdigital
ArtifactId

ArtifactId

pdg-core
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

pdg-core
Microservice query language for Java
Project URL

Project URL

https://github.com/B2W-Digital/pdg-core
Source Code Management

Source Code Management

https://github.com/B2W-Digital/pdg-core

Download pdg-core

How to add to project

<!-- https://jarcasting.com/artifacts/com.b2wdigital/pdg-core/ -->
<dependency>
    <groupId>com.b2wdigital</groupId>
    <artifactId>pdg-core</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.b2wdigital/pdg-core/
implementation 'com.b2wdigital:pdg-core:0.2.0'
// https://jarcasting.com/artifacts/com.b2wdigital/pdg-core/
implementation ("com.b2wdigital:pdg-core:0.2.0")
'com.b2wdigital:pdg-core:jar:0.2.0'
<dependency org="com.b2wdigital" name="pdg-core" rev="0.2.0">
  <artifact name="pdg-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.b2wdigital', module='pdg-core', version='0.2.0')
)
libraryDependencies += "com.b2wdigital" % "pdg-core" % "0.2.0"
[com.b2wdigital/pdg-core "0.2.0"]

Dependencies

compile (9)

Group / Artifact Type Version
org.clojure : clojure jar 1.7.0
http-kit » http-kit jar 2.1.18
org.clojure : tools.logging jar 0.3.1
ring » ring-codec jar 1.0.1
slingshot » slingshot jar 0.12.2
org.clojure : core.async jar 0.1.346.0-17112a-alpha
com.fasterxml.jackson.core : jackson-databind jar 2.8.5
cheshire » cheshire jar 5.5.0
adzerk » bootlaces jar 0.1.13

test (3)

Group / Artifact Type Version
onetom » boot-lein-generate jar 0.1.3
junit : junit jar 4.12
expectations » expectations jar 2.0.9

Project Modules

There are no modules declared in this project.

restQL-clojure allows to run restQL queries, making easy to fetch information from multiple services in the most efficient manner

restQL on travis-ci

Getting Started

Installation

Add restQL dependency to your project

Lein

[b2wdigital/restql-core "3.4.1"]

NPM

npm i @b2wdigital/restql

First query

Clojure

(require '[restql.core.api.restql :as restql])
(restql/execute-query :mappings { :user "http://your.api.url/users/:name" } :query "from user with name = $name" :params { :name "Duke Nukem" } )

Node

var restql = require('@b2wdigital/restql')

// executeQuery(mappings, query, params, options) => <Promise>
restql
  .executeQuery(
    {user: "http://your.api.url/users/:name"},
    "from user with name = $name",
    { name: "Duke Nukem" })
  .then(response => console.log(response))
  .catch(error => console.log(error))

In the example above restQL will call user API passing "Duke Nukem" in the name param.

Our query language

The clause order matters when making restQL queries. The following is a full reference to the query syntax, available clauses and order.

[ [ use modifier = value ] ]

METHOD resource-name [as some-alias] [in some-resource]
  [ headers HEADERS ]
  [ timeout INTEGER_VALUE ]
  [ with WITH_CLAUSES ]
  [ [only FILTERS] OR [hidden] ]
  [ [ignore-errors] ]

e.g:

from search
    with
        role = "hero"

from hero as heroList
    with
        name = search.results.name

Learn more about restQL query language

Links

Reach the community

Who's talking about restQL

License

Copyright © 2016-2019 B2W Digital

Distributed under the MIT License.

Versions

Version
0.2.0
0.1.2
0.1.1