Skip to content

feat: reql format command #14

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rethinkdb",
"version": "2.4.2",
"version": "2.5.0",
"main": "rethinkdb",
"license": "Apache-2.0",
"description": "This package provides the JavaScript driver library for the RethinkDB database server for use in your node application.",
Expand All @@ -17,7 +17,7 @@
],
"homepage": "https://rethinkdb.com",
"bugs": {
"url": "https://github.com/rethinkdb/rethinkdb/issues",
"url": "https://github.com/rethinkdb/rethinkdb-javascript/issues",
"email": "[email protected]"
},
"files": [
Expand All @@ -32,7 +32,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/rethinkdb/rethinkdb.git"
"url": "https://github.com/rethinkdb/rethinkdb-javascript.git"
},
"engines": {
"node": ">= 0.10.0"
Expand Down
3 changes: 1 addition & 2 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash

PACKAGE_NAME="src"
BUILD_DIR="dist"

PROTO_FILE_NAME="ql2.proto"
PROTO_FILE_URL="https://raw.githubusercontent.com/rethinkdb/rethinkdb/next/src/rdb_protocol/${PROTO_FILE_NAME}"
PROTO_FILE_URL="https://raw.githubusercontent.com/rethinkdb/rethinkdb/80b4c72a564230bccc761183ef27bca00fe9a012/src/rdb_protocol/${PROTO_FILE_NAME}"
TARGET_PROTO_FILE="${BUILD_DIR}/${PROTO_FILE_NAME}"

FILE_CONVERTER_NAME="./scripts/convert_protofile.py"
Expand Down
7 changes: 7 additions & 0 deletions src/ast.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class RDBVal extends TermBase
bracket: (args...) -> new Bracket {}, @, args...
toJSON: (args...) -> new ToJsonString {}, @, args...
toJsonString: (args...) -> new ToJsonString {}, @, args...
format: (args...) -> new Format {}, @, args...
match: (args...) -> new Match {}, @, args...
split: (args...) -> new Split {}, @, args.map(funcWrap)...
upcase: (args...) -> new Upcase {}, @, args...
Expand Down Expand Up @@ -857,6 +858,10 @@ class ToJsonString extends RDBOp
tt: protoTermType.TO_JSON_STRING
mt: 'toJsonString'

class Format extends RDBOp
tt: protoTermType.FORMAT
mt: 'format'

class Match extends RDBOp
tt: protoTermType.MATCH
mt: 'match'
Expand Down Expand Up @@ -1368,6 +1373,8 @@ rethinkdb.info = (args...) -> new Info {}, args...

rethinkdb.literal = (args...) -> new Literal {}, args...

rethinkdb.format = (args...) -> new Format {}, args...

rethinkdb.ISO8601 = aropt (str, opts) -> new ISO8601 opts, str
rethinkdb.epochTime = (args...) -> new EpochTime {}, args...
rethinkdb.now = (args...) -> new Now {}, args...
Expand Down