dolthub / dolthub/dolt

`dolt sql -r json` when connected to a running server returns numeric values as strings

Open
#6,072 1 comment 0 reactions 1 assignee Claimed by @zachmu View on GitHub
bug cli sql server
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 9h
Merged PRs (30d)
121

Description

Setup repo:
```sh
rm -rf db
mkdir db
cd db
dolt init
dolt sql << SQL
CREATE TABLE test (a int primary key,v LONGTEXT);
insert into test values (1, "{""key"": ""value""}");
insert into test values (2, """Hello""");
SQL
```

Query the db directly:
```sh
dolt --verbose-engine-setup --data-dir db sql -q "select * from test" -r json
verbose: starting local mode
{"rows": [{"a":1,"v":"{\"key\": \"value\"}"},{"a":2,"v":"\"Hello\""}]}
```

Start dolt sql-server in the DB directory:
```sh
dolt sql-server
```

Query the server:
```sh
dolt --verbose-engine-setup sql -q "select * from test" -r json
verbose: starting remote mode
{"rows": [{"a":"1","v":"{\"key\": \"value\"}"},{"a":"2","v":"\"Hello\""}]}
```

Notice that in the "remote mode" output, when we are querying `sql-server`, the value of `a` is `"1"`, but it should be `1`, as it appears in the "local mode" output.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.