Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding sort method to query language #297

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
45 changes: 45 additions & 0 deletions conformance/tests/ot_sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from __future__ import absolute_import

import gripql

def test_sort_name(man):
errors = []

G = man.setGraph("swapi")

q = G.query().V().hasLabel("Character").sort( "name" )
last = ""
for row in q:
#print(row)
if row["data"]["name"] < last:
errors.append("incorrect sort: %s < %s" % (row["data"]["name"], last))
last = row["data"]["name"]
return errors



def test_sort_units(man):
errors = []
G = man.setGraph("swapi")

q = G.query().V().hasLabel("Vehicle").sort( "max_atmosphering_speed" )
last = 0
for row in q:
#print(row)
value = row["data"]["max_atmosphering_speed"]
if value < last:
errors.append("incorrect sort: %s < %s" % (value, last))
last = value


q = G.query().V().hasLabel("Vehicle").sort( "max_atmosphering_speed", decending=True )
last = 1000000000
for row in q:
#print(row)
value = row["data"]["max_atmosphering_speed"]
if value > last:
errors.append("incorrect sort: %s > %s" % (value, last))
last = value

return errors

90 changes: 90 additions & 0 deletions docs/docs/developer/architecture.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@


gripql-python: "gripql/python" {
text: |md
# gripql

Python library
|
}

gripql-python -> gripql.http

grip-client : "cmd/" {
graph {
create
drop
stream
list
schema
}

data {
kvload
load
dump
mongoload
query
delete
}

config {
mapping
plugin
info
}

jobs {
job
}
}

grip-client -> gripql.grpc

gripql : "gripql/" {

text: |md
Protobuf defined code
|
grpc
grpc-gateway

http -> grpc-gateway
grpc-gateway -> grpc : protobuf via network

http -> grpc-dgw
}


gripql.grpc -> server
gripql.grpc-dgw -> server

server : "server/" {

}

server -> pipeline

pipeline {
gripql-parser
compiler
}

gdbi {
mongo
mongo-core
pebble
}

pipeline.compiler -> gdbi

server -> jobs

jobs {
store
search
drivers : {
opensearch
flat file
}
}
242 changes: 242 additions & 0 deletions docs/docs/index.xml

Large diffs are not rendered by default.

Loading
Loading