You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-3Lines changed: 26 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,15 +340,13 @@ To query, use you favorite MySQL client. On the command line, for example:
340
340
341
341
342
342
```console
343
-
mysql -h 127.0.0.1 --skip-ssl
343
+
mysql -h 127.0.0.1 --skip-ssl MatterSpec
344
344
```
345
345
346
346
The `--skip-ssl` is because `alchemy-db` runs locally without SSL certificates, as a debug tool, yet modern MySQL versions require SSL on the connection unless otherwise specified.
347
347
348
348
##### Semantic tags used across multiple Namespaces
349
349
```sql
350
-
USE MatterSpec;
351
-
352
350
SELECT
353
351
t.nameAS tag,
354
352
ns.nameAS namespace,
@@ -410,3 +408,28 @@ WHERE
410
408
(SELECT NAME FROM LargeEnums)
411
409
);
412
410
```
411
+
412
+
##### Export full list of semantic tags
413
+
```sql
414
+
415
+
SELECT
416
+
n.idAS namespace_id,
417
+
t.idAS tag_id,
418
+
t.nameAS tag_name,
419
+
n.nameAS namespace_name,
420
+
d.nameAS source_name
421
+
FROM
422
+
tag AS t
423
+
INNER JOIN
424
+
namespace AS n ONt.namespace_id=n.namespace_id
425
+
INNER JOIN
426
+
document AS d ONn.document_id=d.document_id
427
+
ORDER BY
428
+
namespace_id ASC, tag_id ASC;
429
+
```
430
+
431
+
An export as CSV of this query can be done directly like this:
432
+
433
+
```console
434
+
mysql -h 127.0.0.1 --skip-ssl --batch -e "SELECT n.id AS namespace_id, t.id AS tag_id, t.name AS tag_name, n.name AS namespace_name, d.name AS source_name FROM tag AS t INNER JOIN namespace AS n ON t.namespace_id = n.namespace_id INNER JOIN document AS d ON n.document_id = d.document_id ORDER BY namespace_id ASC, tag_id ASC;" MatterSpec | sed 's/\t/,/g' > namespaces.csv
0 commit comments