Repository: tobymao/sqlglot

Issue:
Invalid SQL generated when using the json_object function
I'm trying to generate SQL which uses the json_object function. I'm using sqlite dialect. I believe the issue is relevant for more dialects.
```python
import sqlglot
sql = "SELECT json_object('id', 123, 'name', 'John')"
parsed = sqlglot.parse_one(sql)
print(parsed.sql()
```

The printed SQL doesn't run on sqlite, while the original statement runs as expected. This is the returned error:

> sqlite3.OperationalError: unrecognized token: ":"

Hints from issue comments:

Solution patch:
diff --git a/sqlglot/dialects/sqlite.py b/sqlglot/dialects/sqlite.py
index 721e23689c..73b15aad3e 100644
--- a/sqlglot/dialects/sqlite.py
+++ b/sqlglot/dialects/sqlite.py
@@ -140,6 +140,7 @@ class Generator(generator.Generator):
         SUPPORTS_TO_NUMBER = False
         EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE = False
         SUPPORTS_MEDIAN = False
+        JSON_KEY_VALUE_PAIR_SEP = ","
 
         SUPPORTED_JSON_PATH_PARTS = {
             exp.JSONPathKey,


Test patch:
diff --git a/tests/dialects/test_sqlite.py b/tests/dialects/test_sqlite.py
index 066828a20e..ce5185b443 100644
--- a/tests/dialects/test_sqlite.py
+++ b/tests/dialects/test_sqlite.py
@@ -108,6 +108,7 @@ def test_sqlite(self):
             "SELECT * FROM station WHERE city IS NOT ''",
             "SELECT * FROM station WHERE NOT city IS ''",
         )
+        self.validate_identity("SELECT JSON_OBJECT('col1', 1, 'col2', '1')")
 
     def test_strftime(self):
         self.validate_identity("SELECT STRFTIME('%Y/%m/%d', 'now')")