├── LICENSE ├── README.md ├── active-time ├── index.html ├── index.js └── sql-wasm.wasm ├── img ├── example0.png └── example1.png ├── index.html ├── index.js ├── lib ├── bootstrap-material-design.min.css ├── codemirror │ ├── lib │ │ ├── codemirror.css │ │ └── codemirror.js │ └── mode │ │ └── sql │ │ └── sql.js ├── filesaver.min.js ├── metrics-graphics │ ├── metricsgraphics.css │ └── metricsgraphics.min.js └── sql-memory-growth.js ├── sql-wasm.js ├── sql-wasm.wasm └── tables.sql /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 PincongBot 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Pincong SQL 3 | 4 | > 新品葱(WeCenter)数据库在线查询,使用 SQL (sqlite) 语句,支持导出为 JSON 格式 5 | 6 | ## 数据来源 7 | 8 | https://github.com/pin-cong/data/blob/master/pink.sql 9 | 10 | ## 浏览器支持 11 | 12 | * Chrome >= 57 13 | * Firefox >= 53 14 | * Edge >= 16 15 | * Opera >= 44 16 | * Safari >= 11 17 | 18 | 已使用 Chrome 71 测试通过 19 | 20 | ## 使用示例 21 | 22 | #### 按浏览数排序文章 23 | 24 | ```sql 25 | SELECT id, title, views FROM aws_article ORDER BY views DESC; 26 | ``` 27 | 28 |  29 | 30 | #### 查询 "品葱备份" 话题下的全部文章 31 | 32 | ```sql 33 | SELECT id, title, views, comments, votes FROM aws_article 34 | WHERE id IN ( 35 | SELECT item_id FROM aws_topic_relation 36 | WHERE topic_id == (SELECT topic_id FROM aws_topic WHERE "topic_title" == "品葱备份") AND type == "article" 37 | ) 38 | ORDER BY id DESC; 39 | ``` 40 | 41 |  42 | 43 | #### 查询 @一只鹿兒 发表的全部文章 44 | 45 | ```sql 46 | SELECT id, title, message AS content FROM aws_article 47 | WHERE uid == (SELECT uid FROM aws_users WHERE "user_name" == "一只鹿兒") 48 | ORDER BY id DESC; 49 | ``` 50 | 51 | ## 许可证 52 | 53 | 根据 MIT 许可证开源。 54 | -------------------------------------------------------------------------------- /active-time/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 |# | "; 40 | } 41 | columns.forEach(header => { 42 | html += `${header} | `; 43 | }); 44 | html += "
${index} | `; 50 | } 51 | x.forEach(v => { 52 | html += "" + JSON.stringify(v) + " | "; 53 | }); 54 | html += "