· 6 years ago · Jun 08, 2019, 12:56 PM
1# Failed listDataSources
2## RPC Input One Line
3```json
4{"id":1,"jsonrpc":"2.0","method":"listDataSources","params":{"projectInfo":"","datamodel":"model User {\n id String? @default(uuid()) @id @unique\n name String\n}\n\nsource postgres \n type = \"Postgres\"\n url = \"postgres://localhost:5432/prisma\"\n}"}}
5```
6
7## RPC Input Readable
8```json
9{
10 "id": 1,
11 "jsonrpc": "2.0",
12 "method": "listDataSources",
13 "params": {
14 "projectInfo": "",
15 "datamodel": "model User {\n id String? @default(uuid()) @id @unique\n name String\n}\n\nsource postgres \n type = \"Postgres\"\n url = \"postgres://localhost:5432/prisma\"\n}"
16 }
17}
18```
19
20
21## RPC Response
22```
23{
24 "jsonrpc": "2.0",
25 "error": {
26 "code": 4466,
27 "message": "An error happened. Check the data field for details.",
28 "data": {
29 "type": "DataModelErrors",
30 "code": 1000,
31 "errors": [
32 "Unexpected token. Expected one of: end of input, type declaration, model declaration, enum declaration, source definition."
33 ]
34 }
35 },
36 "id": 1
37}
38```
39
40## Stack Trace
41```bash
42[migration-engine/connectors/sql-migration-connector/src/sql_migration_persistence.rs:33] m.make::<barrel::backend::Sqlite>() = "CREATE TABLE IF NOT EXISTS \"migration_engine\".\"_Migration\" (\"revision\" INTEGER NOT NULL PRIMARY KEY, \"name\" TEXT NOT NULL, \"datamodel\" TEXT NOT NULL, \"status\" TEXT NOT NULL, \"applied\" INTEGER NOT NULL, \"rolled_back\" INTEGER NOT NULL, \"datamodel_steps\" TEXT NOT NULL, \"database_migration\" TEXT NOT NULL, \"errors\" TEXT NOT NULL, \"started_at\" DATE NOT NULL, \"finished_at\" DATE);"
43[libs/datamodel/src/ast/parser/mod.rs:384] positives = [
44 EOI,
45 type_declaration,
46 model_declaration,
47 enum_declaration,
48 source_block
49]
50
51```