|
18 | 18 | },
|
19 | 19 | {
|
20 | 20 | "cell_type": "code",
|
21 |
| - "execution_count": null, |
| 21 | + "execution_count": 1, |
22 | 22 | "metadata": {
|
23 | 23 | "collapsed": false
|
24 | 24 | },
|
25 |
| - "outputs": [], |
| 25 | + "outputs": [ |
| 26 | + { |
| 27 | + "name": "stdout", |
| 28 | + "output_type": "stream", |
| 29 | + "text": [ |
| 30 | + "/sparrow-cli/sparrow\n", |
| 31 | + "\n" |
| 32 | + ] |
| 33 | + } |
| 34 | + ], |
26 | 35 | "source": [
|
27 | 36 | "!which sparrow"
|
28 | 37 | ]
|
|
38 | 47 | },
|
39 | 48 | {
|
40 | 49 | "cell_type": "code",
|
41 |
| - "execution_count": null, |
| 50 | + "execution_count": 2, |
42 | 51 | "metadata": {
|
43 | 52 | "ExecuteTime": {
|
44 | 53 | "end_time": "2023-11-22T08:30:58.387715Z",
|
|
47 | 56 | },
|
48 | 57 | "outputs": [],
|
49 | 58 | "source": [
|
50 |
| - "!git clone https://github.com/go-gorm/gorm.git" |
| 59 | + "!git clone https://github.com/go-gorm/gorm.git -q" |
51 | 60 | ]
|
52 | 61 | },
|
53 | 62 | {
|
|
59 | 68 | },
|
60 | 69 | {
|
61 | 70 | "cell_type": "code",
|
62 |
| - "execution_count": null, |
| 71 | + "execution_count": 7, |
63 | 72 | "metadata": {
|
64 | 73 | "ExecuteTime": {
|
65 | 74 | "end_time": "2023-11-23T03:46:32.220317Z",
|
|
68 | 77 | },
|
69 | 78 | "outputs": [],
|
70 | 79 | "source": [
|
71 |
| - "!sparrow database create --source-root gorm --data-language-type go --output ./db/gorm" |
| 80 | + "!sparrow database create --source-root gorm --data-language-type go --output ./db/gorm --overwrite > /dev/null" |
72 | 81 | ]
|
73 | 82 | },
|
74 | 83 | {
|
|
91 | 100 | },
|
92 | 101 | {
|
93 | 102 | "cell_type": "code",
|
94 |
| - "execution_count": null, |
| 103 | + "execution_count": 4, |
95 | 104 | "metadata": {},
|
96 |
| - "outputs": [], |
| 105 | + "outputs": [ |
| 106 | + { |
| 107 | + "name": "stdout", |
| 108 | + "output_type": "stream", |
| 109 | + "text": [ |
| 110 | + "/workspaces/CodeFuse-Query/tutorial/notebook/db/gorm\n" |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "name": "stderr", |
| 115 | + "output_type": "stream", |
| 116 | + "text": [ |
| 117 | + "\u001b[0;31mSparrow database is set to: /workspaces/CodeFuse-Query/tutorial/notebook/db/gorm\n", |
| 118 | + "\u001b[0m" |
| 119 | + ] |
| 120 | + }, |
| 121 | + { |
| 122 | + "name": "stdout", |
| 123 | + "output_type": "stream", |
| 124 | + "text": [ |
| 125 | + "2023-12-06 07:42:29,249 INFO: sparrow 2.0.0\n", |
| 126 | + " will start\n", |
| 127 | + "2023-12-06 07:42:29,249 INFO: database /workspaces/CodeFuse-Query/tutorial/notebook/db/gorm/coref_go_src.db size: 42.32 MB\n", |
| 128 | + "2023-12-06 07:42:29,250 INFO: execute : /sparrow-cli/godel-script/usr/bin/godel /tmp/godel-jupyter-t7lsy12n/query.gdl -p /sparrow-cli/lib-1.0 -o /tmp/tmphp2bm3pi.gdl\n", |
| 129 | + "2023-12-06 07:42:29,314 INFO: godel-script compile time: 0.06s\n", |
| 130 | + "2023-12-06 07:42:29,315 INFO: execute : /sparrow-cli/godel-1.0/usr/bin/godel /tmp/tmphp2bm3pi.gdl --run-souffle-directly --package-path /sparrow-cli/lib-1.0 --souffle-fact-dir /workspaces/CodeFuse-Query/tutorial/notebook/db/gorm --souffle-output-format json --souffle-output-path /tmp/godel-jupyter-t7lsy12n/query.json\n", |
| 131 | + "2023-12-06 07:42:39,655 INFO: Task /tmp/godel-jupyter-t7lsy12n/query.gdl is success, result is NOT-EMPTY, execution time is 10.41s.\n", |
| 132 | + "2023-12-06 07:42:39,656 INFO: run success\n", |
| 133 | + "\n", |
| 134 | + "Total results: 942\n" |
| 135 | + ] |
| 136 | + }, |
| 137 | + { |
| 138 | + "data": { |
| 139 | + "text/html": [ |
| 140 | + "<div>\n", |
| 141 | + "<style scoped>\n", |
| 142 | + " .dataframe tbody tr th:only-of-type {\n", |
| 143 | + " vertical-align: middle;\n", |
| 144 | + " }\n", |
| 145 | + "\n", |
| 146 | + " .dataframe tbody tr th {\n", |
| 147 | + " vertical-align: top;\n", |
| 148 | + " }\n", |
| 149 | + "\n", |
| 150 | + " .dataframe thead th {\n", |
| 151 | + " text-align: right;\n", |
| 152 | + " }\n", |
| 153 | + "</style>\n", |
| 154 | + "<table border=\"1\" class=\"dataframe\">\n", |
| 155 | + " <thead>\n", |
| 156 | + " <tr style=\"text-align: right;\">\n", |
| 157 | + " <th></th>\n", |
| 158 | + " <th>name</th>\n", |
| 159 | + " <th>func</th>\n", |
| 160 | + " <th>cmplx</th>\n", |
| 161 | + " <th>sl</th>\n", |
| 162 | + " <th>el</th>\n", |
| 163 | + " </tr>\n", |
| 164 | + " </thead>\n", |
| 165 | + " <tbody>\n", |
| 166 | + " <tr>\n", |
| 167 | + " <th>0</th>\n", |
| 168 | + " <td>association.go</td>\n", |
| 169 | + " <td>Delete</td>\n", |
| 170 | + " <td>20</td>\n", |
| 171 | + " <td>197</td>\n", |
| 172 | + " <td>361</td>\n", |
| 173 | + " </tr>\n", |
| 174 | + " <tr>\n", |
| 175 | + " <th>1</th>\n", |
| 176 | + " <td>association.go</td>\n", |
| 177 | + " <td>Unscoped</td>\n", |
| 178 | + " <td>1</td>\n", |
| 179 | + " <td>44</td>\n", |
| 180 | + " <td>51</td>\n", |
| 181 | + " </tr>\n", |
| 182 | + " <tr>\n", |
| 183 | + " <th>2</th>\n", |
| 184 | + " <td>association.go</td>\n", |
| 185 | + " <td>Find</td>\n", |
| 186 | + " <td>2</td>\n", |
| 187 | + " <td>53</td>\n", |
| 188 | + " <td>58</td>\n", |
| 189 | + " </tr>\n", |
| 190 | + " <tr>\n", |
| 191 | + " <th>3</th>\n", |
| 192 | + " <td>association.go</td>\n", |
| 193 | + " <td>Association</td>\n", |
| 194 | + " <td>4</td>\n", |
| 195 | + " <td>21</td>\n", |
| 196 | + " <td>42</td>\n", |
| 197 | + " </tr>\n", |
| 198 | + " <tr>\n", |
| 199 | + " <th>4</th>\n", |
| 200 | + " <td>association.go</td>\n", |
| 201 | + " <td>Count</td>\n", |
| 202 | + " <td>2</td>\n", |
| 203 | + " <td>367</td>\n", |
| 204 | + " <td>372</td>\n", |
| 205 | + " </tr>\n", |
| 206 | + " <tr>\n", |
| 207 | + " <th>...</th>\n", |
| 208 | + " <td>...</td>\n", |
| 209 | + " <td>...</td>\n", |
| 210 | + " <td>...</td>\n", |
| 211 | + " <td>...</td>\n", |
| 212 | + " <td>...</td>\n", |
| 213 | + " </tr>\n", |
| 214 | + " <tr>\n", |
| 215 | + " <th>937</th>\n", |
| 216 | + " <td>tests/preload_test.go</td>\n", |
| 217 | + " <td>TestPreloadEmptyData</td>\n", |
| 218 | + " <td>5</td>\n", |
| 219 | + " <td>215</td>\n", |
| 220 | + " <td>235</td>\n", |
| 221 | + " </tr>\n", |
| 222 | + " <tr>\n", |
| 223 | + " <th>938</th>\n", |
| 224 | + " <td>tests/preload_test.go</td>\n", |
| 225 | + " <td>TestPreloadGoroutine</td>\n", |
| 226 | + " <td>2</td>\n", |
| 227 | + " <td>237</td>\n", |
| 228 | + " <td>253</td>\n", |
| 229 | + " </tr>\n", |
| 230 | + " <tr>\n", |
| 231 | + " <th>939</th>\n", |
| 232 | + " <td>tests/preload_test.go</td>\n", |
| 233 | + " <td>TestPreloadWithDiffModel</td>\n", |
| 234 | + " <td>2</td>\n", |
| 235 | + " <td>255</td>\n", |
| 236 | + " <td>271</td>\n", |
| 237 | + " </tr>\n", |
| 238 | + " <tr>\n", |
| 239 | + " <th>940</th>\n", |
| 240 | + " <td>tests/preload_test.go</td>\n", |
| 241 | + " <td>TestNestedPreloadWithUnscoped</td>\n", |
| 242 | + " <td>4</td>\n", |
| 243 | + " <td>273</td>\n", |
| 244 | + " <td>308</td>\n", |
| 245 | + " </tr>\n", |
| 246 | + " <tr>\n", |
| 247 | + " <th>941</th>\n", |
| 248 | + " <td>tests/preload_test.go</td>\n", |
| 249 | + " <td>TestEmbedPreload</td>\n", |
| 250 | + " <td>2</td>\n", |
| 251 | + " <td>310</td>\n", |
| 252 | + " <td>445</td>\n", |
| 253 | + " </tr>\n", |
| 254 | + " </tbody>\n", |
| 255 | + "</table>\n", |
| 256 | + "</div>" |
| 257 | + ], |
| 258 | + "text/plain": [ |
| 259 | + "<IPython.core.display.HTML object>" |
| 260 | + ] |
| 261 | + }, |
| 262 | + "metadata": {}, |
| 263 | + "output_type": "display_data" |
| 264 | + } |
| 265 | + ], |
97 | 266 | "source": [
|
98 | 267 | "%db ./db/gorm\n",
|
99 | 268 | "// script\n",
|
|
137 | 306 | },
|
138 | 307 | {
|
139 | 308 | "cell_type": "code",
|
140 |
| - "execution_count": null, |
| 309 | + "execution_count": 5, |
141 | 310 | "metadata": {},
|
142 |
| - "outputs": [], |
| 311 | + "outputs": [ |
| 312 | + { |
| 313 | + "name": "stdout", |
| 314 | + "output_type": "stream", |
| 315 | + "text": [ |
| 316 | + "Query result saved to /workspaces/CodeFuse-Query/tutorial/notebook/query.json\n" |
| 317 | + ] |
| 318 | + } |
| 319 | + ], |
143 | 320 | "source": [
|
144 | 321 | "%%save_to ./query.json"
|
145 | 322 | ]
|
|
155 | 332 | },
|
156 | 333 | {
|
157 | 334 | "cell_type": "code",
|
158 |
| - "execution_count": null, |
| 335 | + "execution_count": 6, |
159 | 336 | "metadata": {
|
160 | 337 | "ExecuteTime": {
|
161 | 338 | "end_time": "2023-11-23T03:54:56.998681Z",
|
162 | 339 | "start_time": "2023-11-23T03:54:56.976694Z"
|
163 | 340 | },
|
164 | 341 | "collapsed": false
|
165 | 342 | },
|
166 |
| - "outputs": [], |
| 343 | + "outputs": [ |
| 344 | + { |
| 345 | + "name": "stdout", |
| 346 | + "output_type": "stream", |
| 347 | + "text": [ |
| 348 | + " name func cmplx sl el\n", |
| 349 | + "428 schema/field.go ParseField 110 99 436\n", |
| 350 | + "18 callbacks/update.go ConvertToAssignments 69 131 304\n", |
| 351 | + "309 schema/schema.go ParseWithSpecialTableName 68 121 370\n", |
| 352 | + "130 callbacks/create.go ConvertToCreateValues 64 217 385\n", |
| 353 | + "234 scan.go Scan 62 125 342\n", |
| 354 | + "30 statement.go BuildCondition 61 284 465\n", |
| 355 | + "429 schema/field.go setupValuerAndSetter 46 439 969\n", |
| 356 | + "729 tests/migrate_test.go TestMigrateColumns 44 517 645\n", |
| 357 | + "11 callbacks/query.go BuildQuerySQL 41 33 266\n", |
| 358 | + "281 migrator/migrator.go MigrateColumn 41 441 542\n" |
| 359 | + ] |
| 360 | + } |
| 361 | + ], |
167 | 362 | "source": [
|
168 | 363 | "%%python\n",
|
169 | 364 | "import pandas as pd\n",
|
|
199 | 394 | ],
|
200 | 395 | "mimetype": "text/rust",
|
201 | 396 | "name": "rust",
|
202 |
| - "version": "0.0.3" |
| 397 | + "version": "0.0.4" |
203 | 398 | }
|
204 | 399 | },
|
205 | 400 | "nbformat": 4,
|
|
0 commit comments