提交 dc397014 编写于 作者: L luxin

add keywords_must and keywords_forbid

上级 42c80544
{ {
"node_id": "pg-11d131b2d01b40be90b23f096d4852cc", "node_id": "pg-11d131b2d01b40be90b23f096d4852cc",
"keywords": ["关系型数据库", "database", "relational", "rdbms"], "keywords": [
"关系型数据库",
"database",
"relational",
"rdbms"
],
"children": [], "children": [],
"export": [ "export": [
"relation.json" "relation.json"
] ],
"keywords_must": [
"关系型数据库",
"database",
"relational",
"rdbms"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-cf0e5cb243a247e2a0b812c5798cdba4", "node_id": "pg-cf0e5cb243a247e2a0b812c5798cdba4",
"keywords": ["server", "client", "数据库服务器", "数据库客户端"], "keywords": [
"server",
"client",
"数据库服务器",
"数据库客户端"
],
"children": [], "children": [],
"export": [ "export": [
"client.json", "client.json",
"server.json" "server.json"
] ],
"keywords_must": [
"服务器",
"客户端"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-1aad17890736469a8b2f61a36dfe41db", "node_id": "pg-1aad17890736469a8b2f61a36dfe41db",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-940afa6d71af44f689011ded8fd91a98", "node_id": "pg-940afa6d71af44f689011ded8fd91a98",
"keywords": ["安装", "PostgreSQL"], "keywords": [
"安装",
"PostgreSQL"
],
"children": [], "children": [],
"export": ["install.json"] "export": [
"install.json"
],
"keywords_must": [
"安装"
],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -9,5 +9,9 @@ ...@@ -9,5 +9,9 @@
"export": [ "export": [
"login.json", "login.json",
"rds.json" "rds.json"
] ],
"keywords_must": [
"登录"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-c252ff4b0e7f4163837c9b6f81678505", "node_id": "pg-c252ff4b0e7f4163837c9b6f81678505",
"keywords": ["login", "connect"], "keywords": [
"login",
"connect"
],
"children": [], "children": [],
"export": ["develop.json"] "export": [
"develop.json"
],
"keywords_must": [
"使用",
"基本用法",
"入门"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-d95edf2d942b45d781e112be785ce260", "node_id": "pg-d95edf2d942b45d781e112be785ce260",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-ee5c6d4a073b45a7995ba351ab9de46e", "node_id": "pg-ee5c6d4a073b45a7995ba351ab9de46e",
"keywords": ["sql", "psql", " 数据库客户端"], "keywords": [
"sql",
"psql",
" 数据库客户端"
],
"children": [], "children": [],
"export": ["psql.json"] "export": [
"psql.json"
],
"keywords_must": [
"psql"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-dca8da7637f94ded91a1871daa51746e", "node_id": "pg-dca8da7637f94ded91a1871daa51746e",
"keywords": ["语法", "select"], "keywords": [
"语法",
"select"
],
"children": [], "children": [],
"export": ["basic.json"] "export": [
"basic.json"
],
"keywords_must": [
"语法",
"SQL"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-b0f366abe12e41b0a9672d317e556662", "node_id": "pg-b0f366abe12e41b0a9672d317e556662",
"keywords": ["DML", "insert", "update", "delete"], "keywords": [
"DML",
"insert",
"update",
"delete"
],
"children": [], "children": [],
"export": [ "export": [
"insert.json", "insert.json",
"update.json", "update.json",
"delete.json", "delete.json",
"concept.json" "concept.json"
] ],
"keywords_must": [
"DML",
"DDL",
"insert",
"update",
"delete"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-30f905f73a574151994d6d7f58d8a20d", "node_id": "pg-30f905f73a574151994d6d7f58d8a20d",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-f1c160affc45417a9c5fff7dc4be448a", "node_id": "pg-f1c160affc45417a9c5fff7dc4be448a",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -9,5 +9,10 @@ ...@@ -9,5 +9,10 @@
"table.json", "table.json",
"create_table.json", "create_table.json",
"serial.json" "serial.json"
] ],
"keywords_must": [
"表",
"table"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-f371b91ef63a4ce08f80b92bc8580196", "node_id": "pg-f371b91ef63a4ce08f80b92bc8580196",
"keywords": ["函数", "function"], "keywords": [
"函数",
"function"
],
"children": [], "children": [],
"export": ["function.json"] "export": [
"function.json"
],
"keywords_must": [
"函数",
"function"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-cb942198b3a84d5398d73d558a241543", "node_id": "pg-cb942198b3a84d5398d73d558a241543",
"keywords": ["role", "login", "user", "用户", "角色", "权限", "privilege"], "keywords": [
"role",
"login",
"user",
"用户",
"角色",
"权限",
"privilege"
],
"children": [], "children": [],
"export": [ "export": [
"grant.json", "grant.json",
"revoke.json", "revoke.json",
"role.json" "role.json"
] ],
"keywords_must": [
"role",
"login",
"user",
"用户",
"角色",
"权限",
"privilege"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-eeb777ca54434480a06bfe7fc5e7d3ca", "node_id": "pg-eeb777ca54434480a06bfe7fc5e7d3ca",
"keywords": ["索引", " 约束", "constraints", "index"], "keywords": [
"索引",
" 约束",
"constraints",
"index"
],
"children": [], "children": [],
"export": ["primary_key.json","unique.json", "unique_2.json"] "export": [
"primary_key.json",
"unique.json",
"unique_2.json"
],
"keywords_must": [
"索引",
" 约束",
"constraints",
"index"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-a0cb78d68d814f5e935b41922b88e085", "node_id": "pg-a0cb78d68d814f5e935b41922b88e085",
"keywords": ["trigger", "触发器"], "keywords": [
"trigger",
"触发器"
],
"children": [], "children": [],
"export": ["trigger.json"] "export": [
"trigger.json"
],
"keywords_must": [
"trigger",
"触发器"
],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -9,5 +9,10 @@ ...@@ -9,5 +9,10 @@
"export": [ "export": [
"language.json", "language.json",
"extension.json" "extension.json"
] ],
"keywords_must": [
"数据库扩展",
"extension"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-100e256ddb2e43ea8d68558e73522819", "node_id": "pg-100e256ddb2e43ea8d68558e73522819",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -7,5 +7,11 @@ ...@@ -7,5 +7,11 @@
"children": [], "children": [],
"export": [ "export": [
"salary.json" "salary.json"
] ],
"keywords_must": [
"group by",
"分组",
"聚合"
],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -7,5 +7,10 @@ ...@@ -7,5 +7,10 @@
"children": [], "children": [],
"export": [ "export": [
"customer_order.json" "customer_order.json"
] ],
"keywords_must": [
"join",
"连接查询"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-55fd213f919d411c9b572241c4bb7807", "node_id": "pg-55fd213f919d411c9b572241c4bb7807",
"keywords": ["子查询", "subquery"], "keywords": [
"子查询",
"subquery"
],
"children": [], "children": [],
"export": [ "export": [
"subquery.json" "subquery.json"
] ],
"keywords_must": [
"子查询",
"subquery"
],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -8,5 +8,11 @@ ...@@ -8,5 +8,11 @@
"children": [], "children": [],
"export": [ "export": [
"paged.json" "paged.json"
] ],
"keywords_must": [
"分页",
"limit",
"offset"
],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -8,5 +8,9 @@ ...@@ -8,5 +8,9 @@
"children": [], "children": [],
"export": [ "export": [
"to_root.json" "to_root.json"
] ],
"keywords_must": [
"cte"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-eb4048b7dfd3469f8049330ba78427b5", "node_id": "pg-eb4048b7dfd3469f8049330ba78427b5",
"keywords": ["plsql", "过程化"], "keywords": [
"plsql",
"过程化"
],
"children": [], "children": [],
"export": ["loop.json"] "export": [
"loop.json"
],
"keywords_must": [
"过程化"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-0378bcd60ccd4dfebcfead92abbdd673", "node_id": "pg-0378bcd60ccd4dfebcfead92abbdd673",
"keywords": ["创建表", "授权", "ddl"], "keywords": [
"创建表",
"授权",
"ddl"
],
"children": [], "children": [],
"export": [ "export": [
"create_table.json", "create_table.json",
"analyze.json" "analyze.json"
] ],
"keywords_must": [
"创建表",
"授权",
"ddl"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-c99d8673d47444988c37f6dd3abb1e63", "node_id": "pg-c99d8673d47444988c37f6dd3abb1e63",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-fc32585f4136497ea9be2d057d4aeada", "node_id": "pg-fc32585f4136497ea9be2d057d4aeada",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-58e924e93b564a24abb1e6b9cdfbc094", "node_id": "pg-58e924e93b564a24abb1e6b9cdfbc094",
"keywords": ["standby", "热备份", "高可用", "流复制"], "keywords": [
"standby",
"热备份",
"高可用",
"流复制"
],
"children": [], "children": [],
"export": [ "export": [
"standby.json", "standby.json",
"backup.json" "backup.json"
] ],
"keywords_must": [
"standby"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-7eff3dcf68644c23bd89f2a2abe4fac6", "node_id": "pg-7eff3dcf68644c23bd89f2a2abe4fac6",
"keywords": ["standby", "高可用", "流复制", "wal"], "keywords": [
"standby",
"高可用",
"流复制",
"wal"
],
"children": [], "children": [],
"export": ["stream.json"] "export": [
"stream.json"
],
"keywords_must": [
"流式复制",
"流复制"
],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -7,5 +7,10 @@ ...@@ -7,5 +7,10 @@
"children": [], "children": [],
"export": [ "export": [
"fdw.json" "fdw.json"
] ],
"keywords_must": [
"外部数据连接",
"fdw"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-328b09c201b6414d83228970591910af", "node_id": "pg-328b09c201b6414d83228970591910af",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-3bbe12c0a19d4cb7a61dc0a20624ed89", "node_id": "pg-3bbe12c0a19d4cb7a61dc0a20624ed89",
"keywords": ["gis", "地理信息"], "keywords": [
"gis",
"地理信息"
],
"children": [], "children": [],
"export": ["gis.json"] "export": [
"gis.json"
],
"keywords_must": [
"gis",
"几何"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-69ad784e39c044d7a115cfd124e49ef1", "node_id": "pg-69ad784e39c044d7a115cfd124e49ef1",
"keywords": ["json", "jsonb"], "keywords": [
"json",
"jsonb"
],
"children": [], "children": [],
"export": [ "export": [
"json.json", "json.json",
"match.json", "match.json",
"tags.json" "tags.json"
] ],
"keywords_must": [
"json",
"jsonb"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-6dbbb44b41d347b58075a9155dfb8356", "node_id": "pg-6dbbb44b41d347b58075a9155dfb8356",
"keywords": ["函数", "过程", "function", "produce"], "keywords": [
"函数",
"过程",
"function",
"produce"
],
"children": [], "children": [],
"export": ["distinct.json"] "export": [
"distinct.json"
],
"keywords_must": [
"聚合函数",
"json函数",
[
"数组",
"函数"
],
""
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-532f8f84ea74493a9581e6bf720ebf78", "node_id": "pg-532f8f84ea74493a9581e6bf720ebf78",
"keywords": ["视图", "view"], "keywords": [
"视图",
"view"
],
"children": [], "children": [],
"export": ["view.json"] "export": [
"view.json"
],
"keywords_must": [
"视图",
"view"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-f80410c703044bfea61b2f3a4fbc5705", "node_id": "pg-f80410c703044bfea61b2f3a4fbc5705",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-2e691ed3a847424eb887b40aca750c4e", "node_id": "pg-2e691ed3a847424eb887b40aca750c4e",
"keywords": ["cte", "递归查询", "recursive"], "keywords": [
"cte",
"递归查询",
"recursive"
],
"children": [], "children": [],
"export": [ "export": [
"continuous.json" "continuous.json"
] ],
"keywords_must": [
"cte",
"递归查询",
"recursive"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"keywords": ["函数", "function"], "keywords": [
"函数",
"function"
],
"children": [], "children": [],
"node_id": "pg-cab66a558cda467eabd9587b5a8257bd", "node_id": "pg-cab66a558cda467eabd9587b5a8257bd",
"export": [ "export": [
"salary.json" "salary.json"
] ],
"keywords_must": [
"函数",
"function",
"window"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-693a81467f444886a199bac681f238b8", "node_id": "pg-693a81467f444886a199bac681f238b8",
"keywords": ["透视表", "交叉透视表", "pivot"], "keywords": [
"透视表",
"交叉透视表",
"pivot"
],
"children": [], "children": [],
"export": ["pivot.json"] "export": [
"pivot.json"
],
"keywords_must": [
"透视表",
"交叉透视表",
"pivot"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-6ce3520f7a67494a90378e7b194f8720", "node_id": "pg-6ce3520f7a67494a90378e7b194f8720",
"keywords": ["conflict", "冲突", "唯一约束"], "keywords": [
"conflict",
"冲突",
"唯一约束"
],
"children": [], "children": [],
"export": ["score.json"] "export": [
"score.json"
],
"keywords_must": [
"conflict",
"冲突"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-2d547e778fc4453b84feb0a0c6341348", "node_id": "pg-2d547e778fc4453b84feb0a0c6341348",
"keywords": ["事务", "transaction"], "keywords": [
"事务",
"transaction"
],
"children": [], "children": [],
"export": ["transaction.json"] "export": [
"transaction.json"
],
"keywords_must": [
"事务",
"transaction"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-79fe660f35f4469481db38509343c2b7", "node_id": "pg-79fe660f35f4469481db38509343c2b7",
"keywords": ["索引", "index", "performance", "优化"], "keywords": [
"索引",
"index",
"performance",
"优化"
],
"children": [], "children": [],
"export": [ "export": [
"daily_payment.json", "daily_payment.json",
"daily_payment_2.json" "daily_payment_2.json"
] ],
"keywords_must": [
"索引",
"index",
"performance",
"优化"
],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-9e66230caa834cb99a2390c7f71fb582", "node_id": "pg-9e66230caa834cb99a2390c7f71fb582",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "pg-c9c7629c52064d8780cbd4dc14dbe351", "node_id": "pg-c9c7629c52064d8780cbd4dc14dbe351",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"tree_name": "pg", "tree_name": "pg",
"keywords": [], "keywords": [],
"node_id": "pg-d8b0b9aded4c4cc0b2085d6a7c5611c7" "node_id": "pg-d8b0b9aded4c4cc0b2085d6a7c5611c7",
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -22,7 +22,14 @@ ...@@ -22,7 +22,14 @@
"relational", "relational",
"rdbms" "rdbms"
], ],
"children": [] "children": [],
"keywords_must": [
"关系型数据库",
"database",
"relational",
"rdbms"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -34,10 +41,17 @@ ...@@ -34,10 +41,17 @@
"数据库服务器", "数据库服务器",
"数据库客户端" "数据库客户端"
], ],
"children": [] "children": [],
"keywords_must": [
"服务器",
"客户端"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -52,7 +66,11 @@ ...@@ -52,7 +66,11 @@
"安装", "安装",
"PostgreSQL" "PostgreSQL"
], ],
"children": [] "children": [],
"keywords_must": [
"安装"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -63,7 +81,11 @@ ...@@ -63,7 +81,11 @@
"身份验证", "身份验证",
"授权" "授权"
], ],
"children": [] "children": [],
"keywords_must": [
"登录"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -73,10 +95,18 @@ ...@@ -73,10 +95,18 @@
"login", "login",
"connect" "connect"
], ],
"children": [] "children": [],
"keywords_must": [
"使用",
"基本用法",
"入门"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -92,7 +122,11 @@ ...@@ -92,7 +122,11 @@
"psql", "psql",
" 数据库客户端" " 数据库客户端"
], ],
"children": [] "children": [],
"keywords_must": [
"psql"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -102,7 +136,12 @@ ...@@ -102,7 +136,12 @@
"语法", "语法",
"select" "select"
], ],
"children": [] "children": [],
"keywords_must": [
"语法",
"SQL"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -114,13 +153,25 @@ ...@@ -114,13 +153,25 @@
"update", "update",
"delete" "delete"
], ],
"children": [] "children": [],
"keywords_must": [
"DML",
"DDL",
"insert",
"update",
"delete"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -140,7 +191,12 @@ ...@@ -140,7 +191,12 @@
"表", "表",
"table" "table"
], ],
"children": [] "children": [],
"keywords_must": [
"表",
"table"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -150,7 +206,12 @@ ...@@ -150,7 +206,12 @@
"函数", "函数",
"function" "function"
], ],
"children": [] "children": [],
"keywords_must": [
"函数",
"function"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -165,7 +226,17 @@ ...@@ -165,7 +226,17 @@
"权限", "权限",
"privilege" "privilege"
], ],
"children": [] "children": [],
"keywords_must": [
"role",
"login",
"user",
"用户",
"角色",
"权限",
"privilege"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -177,7 +248,14 @@ ...@@ -177,7 +248,14 @@
"constraints", "constraints",
"index" "index"
], ],
"children": [] "children": [],
"keywords_must": [
"索引",
" 约束",
"constraints",
"index"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -187,7 +265,12 @@ ...@@ -187,7 +265,12 @@
"trigger", "trigger",
"触发器" "触发器"
], ],
"children": [] "children": [],
"keywords_must": [
"trigger",
"触发器"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -198,10 +281,17 @@ ...@@ -198,10 +281,17 @@
"数据库插件", "数据库插件",
"extension" "extension"
], ],
"children": [] "children": [],
"keywords_must": [
"数据库扩展",
"extension"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -216,7 +306,13 @@ ...@@ -216,7 +306,13 @@
"group by", "group by",
"分组" "分组"
], ],
"children": [] "children": [],
"keywords_must": [
"group by",
"分组",
"聚合"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -226,7 +322,12 @@ ...@@ -226,7 +322,12 @@
"join", "join",
"连接查询" "连接查询"
], ],
"children": [] "children": [],
"keywords_must": [
"join",
"连接查询"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -236,7 +337,12 @@ ...@@ -236,7 +337,12 @@
"子查询", "子查询",
"subquery" "subquery"
], ],
"children": [] "children": [],
"keywords_must": [
"子查询",
"subquery"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -247,7 +353,13 @@ ...@@ -247,7 +353,13 @@
"limit", "limit",
"offset" "offset"
], ],
"children": [] "children": [],
"keywords_must": [
"分页",
"limit",
"offset"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -258,7 +370,11 @@ ...@@ -258,7 +370,11 @@
"cte", "cte",
"recursive" "recursive"
], ],
"children": [] "children": [],
"keywords_must": [
"cte"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -268,7 +384,11 @@ ...@@ -268,7 +384,11 @@
"plsql", "plsql",
"过程化" "过程化"
], ],
"children": [] "children": [],
"keywords_must": [
"过程化"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -279,13 +399,23 @@ ...@@ -279,13 +399,23 @@
"授权", "授权",
"ddl" "ddl"
], ],
"children": [] "children": [],
"keywords_must": [
"创建表",
"授权",
"ddl"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -307,7 +437,11 @@ ...@@ -307,7 +437,11 @@
"高可用", "高可用",
"流复制" "流复制"
], ],
"children": [] "children": [],
"keywords_must": [
"standby"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -319,7 +453,12 @@ ...@@ -319,7 +453,12 @@
"流复制", "流复制",
"wal" "wal"
], ],
"children": [] "children": [],
"keywords_must": [
"流式复制",
"流复制"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -329,10 +468,17 @@ ...@@ -329,10 +468,17 @@
"外部数据连接", "外部数据连接",
"fdw" "fdw"
], ],
"children": [] "children": [],
"keywords_must": [
"外部数据连接",
"fdw"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -347,7 +493,12 @@ ...@@ -347,7 +493,12 @@
"gis", "gis",
"地理信息" "地理信息"
], ],
"children": [] "children": [],
"keywords_must": [
"gis",
"几何"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -357,7 +508,12 @@ ...@@ -357,7 +508,12 @@
"json", "json",
"jsonb" "jsonb"
], ],
"children": [] "children": [],
"keywords_must": [
"json",
"jsonb"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -369,7 +525,17 @@ ...@@ -369,7 +525,17 @@
"function", "function",
"produce" "produce"
], ],
"children": [] "children": [],
"keywords_must": [
"聚合函数",
"json函数",
[
"数组",
"函数"
],
""
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -379,10 +545,17 @@ ...@@ -379,10 +545,17 @@
"视图", "视图",
"view" "view"
], ],
"children": [] "children": [],
"keywords_must": [
"视图",
"view"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -398,7 +571,13 @@ ...@@ -398,7 +571,13 @@
"递归查询", "递归查询",
"recursive" "recursive"
], ],
"children": [] "children": [],
"keywords_must": [
"cte",
"递归查询",
"recursive"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -408,7 +587,13 @@ ...@@ -408,7 +587,13 @@
"函数", "函数",
"function" "function"
], ],
"children": [] "children": [],
"keywords_must": [
"函数",
"function",
"window"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -419,7 +604,13 @@ ...@@ -419,7 +604,13 @@
"交叉透视表", "交叉透视表",
"pivot" "pivot"
], ],
"children": [] "children": [],
"keywords_must": [
"透视表",
"交叉透视表",
"pivot"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -430,7 +621,12 @@ ...@@ -430,7 +621,12 @@
"冲突", "冲突",
"唯一约束" "唯一约束"
], ],
"children": [] "children": [],
"keywords_must": [
"conflict",
"冲突"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -440,7 +636,12 @@ ...@@ -440,7 +636,12 @@
"事务", "事务",
"transaction" "transaction"
], ],
"children": [] "children": [],
"keywords_must": [
"事务",
"transaction"
],
"keywords_forbid": []
} }
}, },
{ {
...@@ -452,15 +653,28 @@ ...@@ -452,15 +653,28 @@
"performance", "performance",
"优化" "优化"
], ],
"children": [] "children": [],
"keywords_must": [
"索引",
"index",
"performance",
"优化"
],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
} }
\ No newline at end of file
...@@ -2,10 +2,11 @@ import json ...@@ -2,10 +2,11 @@ import json
import logging import logging
import os import os
import re import re
import subprocess
import sys import sys
import uuid import uuid
import re import re
import git
id_set = set() id_set = set()
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -14,10 +15,20 @@ handler = logging.StreamHandler(sys.stdout) ...@@ -14,10 +15,20 @@ handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter) handler.setFormatter(formatter)
logger.addHandler(handler) logger.addHandler(handler)
repo = git.Repo(".")
def user_name():
return repo.config_reader().get_value("user", "name") def user_name(md_file, author_dict):
ret = subprocess.Popen([
"git", "log", md_file
], stdout=subprocess.PIPE)
lines = list(map(lambda l: l.decode(), ret.stdout.readlines()))
author_lines = []
for line in lines:
if line.startswith('Author'):
author_lines.append(line.split(' ')[1])
author_nick_name = author_lines[-1]
return author_dict.get(author_nick_name, "")
def load_json(p): def load_json(p):
with open(p, 'r') as f: with open(p, 'r') as f:
...@@ -75,7 +86,18 @@ def check_export(base, cfg): ...@@ -75,7 +86,18 @@ def check_export(base, cfg):
class TreeWalker: class TreeWalker:
def __init__(self, root, tree_name, title=None, log=None): def __init__(
self, root,
tree_name,
title=None,
log=None,
authors=None,
enable_notebook=None,
ignore_keywords=False
):
self.ignore_keywords = ignore_keywords
self.authors = authors if authors else {}
self.enable_notebook = enable_notebook
self.name = tree_name self.name = tree_name
self.root = root self.root = root
self.title = tree_name if title is None else title self.title = tree_name if title is None else title
...@@ -87,7 +109,9 @@ class TreeWalker: ...@@ -87,7 +109,9 @@ class TreeWalker:
root_node = { root_node = {
"node_id": root["node_id"], "node_id": root["node_id"],
"keywords": root["keywords"], "keywords": root["keywords"],
"children": [] "children": [],
"keywords_must": root["keywords_must"],
"keywords_forbid": root["keywords_forbid"]
} }
self.tree[root["tree_name"]] = root_node self.tree[root["tree_name"]] = root_node
self.load_levels(root_node) self.load_levels(root_node)
...@@ -100,11 +124,13 @@ class TreeWalker: ...@@ -100,11 +124,13 @@ class TreeWalker:
for index, chapter in enumerate(level_node["children"]): for index, chapter in enumerate(level_node["children"]):
chapter_title = list(chapter.keys())[0] chapter_title = list(chapter.keys())[0]
chapter_node = list(chapter.values())[0] chapter_node = list(chapter.values())[0]
chapter_path = os.path.join(level_path, f"{index + 1}.{chapter_title}") chapter_path = os.path.join(
level_path, f"{index + 1}.{chapter_title}")
self.load_sections(chapter_path, chapter_node) self.load_sections(chapter_path, chapter_node)
for index, section_node in enumerate(chapter_node["children"]): for index, section_node in enumerate(chapter_node["children"]):
section_title = list(section_node.keys())[0] section_title = list(section_node.keys())[0]
full_path = os.path.join(chapter_path, f"{index + 1}.{section_title}") full_path = os.path.join(
chapter_path, f"{index + 1}.{section_title}")
if os.path.isdir(full_path): if os.path.isdir(full_path):
self.check_section_keywords(full_path) self.check_section_keywords(full_path)
self.ensure_exercises(full_path) self.ensure_exercises(full_path)
...@@ -140,6 +166,8 @@ class TreeWalker: ...@@ -140,6 +166,8 @@ class TreeWalker:
"node_id": config["node_id"], "node_id": config["node_id"],
"keywords": config["keywords"], "keywords": config["keywords"],
"children": [], "children": [],
"keywords_must": config["keywords_must"],
"keywords_forbid": config["keywords_forbid"]
} }
} }
...@@ -191,6 +219,8 @@ class TreeWalker: ...@@ -191,6 +219,8 @@ class TreeWalker:
"tree_name": self.name, "tree_name": self.name,
"keywords": [], "keywords": [],
"node_id": self.gen_node_id(), "node_id": self.gen_node_id(),
"keywords_must": [],
"keywords_forbid": []
} }
dump_json(config_path, config, exist_ok=True, override=True) dump_json(config_path, config, exist_ok=True, override=True)
else: else:
...@@ -220,7 +250,9 @@ class TreeWalker: ...@@ -220,7 +250,9 @@ class TreeWalker:
if not os.path.exists(config_path): if not os.path.exists(config_path):
config = { config = {
"node_id": self.gen_node_id(), "node_id": self.gen_node_id(),
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
dump_json(config_path, config, exist_ok=True, override=True) dump_json(config_path, config, exist_ok=True, override=True)
else: else:
...@@ -286,6 +318,8 @@ class TreeWalker: ...@@ -286,6 +318,8 @@ class TreeWalker:
"node_id": config["node_id"], "node_id": config["node_id"],
"keywords": config["keywords"], "keywords": config["keywords"],
"children": [], "children": [],
"keywords_must": config["keywords_must"],
"keywords_forbid": config["keywords_forbid"]
} }
} }
return num, result return num, result
...@@ -297,7 +331,9 @@ class TreeWalker: ...@@ -297,7 +331,9 @@ class TreeWalker:
name: { name: {
"node_id": config["node_id"], "node_id": config["node_id"],
"keywords": config["keywords"], "keywords": config["keywords"],
"children": config.get("children", []) "children": config.get("children", []),
"keywords_must": config["keywords_must"],
"keywords_forbid": config["keywords_forbid"]
} }
} }
# if "children" in config: # if "children" in config:
...@@ -314,7 +350,8 @@ class TreeWalker: ...@@ -314,7 +350,8 @@ class TreeWalker:
continue continue
mfile = base + ".json" mfile = base + ".json"
meta_path = os.path.join(section_path, mfile) meta_path = os.path.join(section_path, mfile)
self.ensure_exercises_meta(meta_path, source) md_file = os.path.join(section_path, e)
self.ensure_exercises_meta(meta_path, source, md_file)
export = config.get("export", []) export = config.get("export", [])
if mfile not in export and self.name != "algorithm": if mfile not in export and self.name != "algorithm":
export.append(mfile) export.append(mfile)
...@@ -322,7 +359,8 @@ class TreeWalker: ...@@ -322,7 +359,8 @@ class TreeWalker:
config["export"] = export config["export"] = export
if flag: if flag:
dump_json(os.path.join(section_path, "config.json"), config, True, True) dump_json(os.path.join(section_path, "config.json"),
config, True, True)
for e in config.get("export", []): for e in config.get("export", []):
full_name = os.path.join(section_path, e) full_name = os.path.join(section_path, e)
...@@ -334,7 +372,7 @@ class TreeWalker: ...@@ -334,7 +372,7 @@ class TreeWalker:
else: else:
id_set.add(exercise["exercise_id"]) id_set.add(exercise["exercise_id"])
def ensure_exercises_meta(self, meta_path, source): def ensure_exercises_meta(self, meta_path, source, md_file):
_, mfile = os.path.split(meta_path) _, mfile = os.path.split(meta_path)
meta = None meta = None
if os.path.exists(meta_path): if os.path.exists(meta_path):
...@@ -349,26 +387,31 @@ class TreeWalker: ...@@ -349,26 +387,31 @@ class TreeWalker:
if "source" not in meta: if "source" not in meta:
meta["source"] = source meta["source"] = source
if "author" not in meta: if "author" not in meta:
meta["author"] = user_name() meta["author"] = user_name(md_file, self.authors)
if "type" not in meta: if "type" not in meta:
meta["type"] = "code_options" meta["type"] = "code_options"
if meta is None:
meta = { if meta is None:
"type": "code_options", meta = {
"author": user_name(), "type": "code_options",
"source": source, "author": user_name(md_file, self.authors),
"notebook_enable": self.default_notebook(), "source": source,
"exercise_id": uuid.uuid4().hex "notebook_enable": self.default_notebook(),
} "exercise_id": uuid.uuid4().hex
}
dump_json(meta_path, meta, True, True) dump_json(meta_path, meta, True, True)
def default_notebook(self): def default_notebook(self):
if self.enable_notebook is not None:
return self.enable_notebook
if self.name in ["python", "java", "c"]: if self.name in ["python", "java", "c"]:
return True return True
else: else:
return False return False
def check_section_keywords(self, full_path): def check_section_keywords(self, full_path):
if self.ignore_keywords:
return
config = self.ensure_section_config(full_path) config = self.ensure_section_config(full_path)
if not config.get("keywords", []): if not config.get("keywords", []):
self.logger.error(f"节点 [{full_path}] 的关键字为空,请修改配置文件写入关键字") self.logger.error(f"节点 [{full_path}] 的关键字为空,请修改配置文件写入关键字")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册