finox 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a15f212853df20da508fd87569b5192f8ce118a0db17dc0618021bff0a65e9b2
4
- data.tar.gz: c05ef1e80ab78e4770f8ea84910b957b9981bd6681844540e42342f83e406635
3
+ metadata.gz: 83968491f3b1eb89b0cf89b54d5b955fb947865b90e4a190b602bd2c5cc602d0
4
+ data.tar.gz: 2a3059fa42822f8fd3c648b95314ebf25bb59a6d4e8b64ca3106e93cf33c91f8
5
5
  SHA512:
6
- metadata.gz: b56ad84053f70ee5957e27b647148f19d703788d4fd430239d6a4927fa637f21800787e988258093bb1db7c9234792f5bf56ee4f69980fd9fa63cf51d41b9b56
7
- data.tar.gz: b297a5a6420d07819bcc664823a62cf476f103c4a4de7a4ec98c3824874ce6b214c38dcf46053e550f3d2ad98a51589fa43a683b07aca2f57aacc7e38baadde7
6
+ metadata.gz: c34ff0cc051d4b30d062bb8a72595f5423fce129eb630242c8f83dfe2ef70de669c29d9af25c2542dbff8019af518c5d081a9a7170ef1a063145d0c6a14eca37
7
+ data.tar.gz: f17bcbcc65fe8b58fdfa056a6de997954cf214f9646c8e2a55d9c6b6702999638ed9a4f4668b28312f069c58e819b1d5ccccb1eee09af17bd5cc0c09ec5a9d31
data/CHANGELOG.md CHANGED
@@ -1,4 +1,28 @@
1
- ## [Unreleased]
1
+ ## [0.2.0] - 2026-07-18
2
+
3
+ - **Breaking:** `Finox.parse` now returns a `Finox::Result` instead of a plain Array.
4
+ - Add `Finox::Result#tables`, which returns the tables referenced across all
5
+ parsed statements (including joins, subqueries and DML targets), deduplicated
6
+ and excluding CTE names.
7
+ - Add `Finox::Result#columns`, which returns the columns referenced across all
8
+ parsed statements (including `INSERT` column lists and `UPDATE` assignment
9
+ targets), deduplicated.
10
+ - Add `Finox::Result#statement_types`, which returns the type of each parsed
11
+ statement (sqlparser's variant names, e.g. `"Query"`, `"Insert"`).
12
+ - Add `Finox::Result#select_tables`, `#dml_tables` and `#ddl_tables`, which
13
+ classify the referenced tables into read, written by DML and targeted by DDL
14
+ (a table appearing in multiple roles is listed in each).
15
+ - Add `Finox::Result#normalize`, which returns the SQL with literals replaced
16
+ by `?` placeholders, deparsed from the AST (normalizing formatting and
17
+ keyword case).
18
+ - Add `Finox::Result#fingerprint`, which returns a 64-bit hex hash of the
19
+ normalized SQL, for grouping queries that differ only in literals or
20
+ formatting. Fingerprints are not guaranteed to be stable across finox
21
+ versions.
22
+ - Add `Finox::Result#statements`, which returns the AST of each parsed
23
+ statement as plain Hashes/Arrays. All keys are Strings (previously enum
24
+ variant names were Strings but struct fields were Symbols).
25
+ - Precompiled gems now include a shared object for Ruby 4.0.
2
26
 
3
27
  ## [0.1.0] - 2026-07-17
4
28
 
data/Cargo.lock CHANGED
@@ -86,6 +86,12 @@ version = "1.16.0"
86
86
  source = "registry+https://github.com/rust-lang/crates.io-index"
87
87
  checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
88
88
 
89
+ [[package]]
90
+ name = "equivalent"
91
+ version = "1.0.2"
92
+ source = "registry+https://github.com/rust-lang/crates.io-index"
93
+ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
94
+
89
95
  [[package]]
90
96
  name = "find-msvc-tools"
91
97
  version = "0.1.9"
@@ -94,11 +100,12 @@ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
94
100
 
95
101
  [[package]]
96
102
  name = "finox"
97
- version = "0.1.0"
103
+ version = "0.2.0"
98
104
  dependencies = [
99
105
  "magnus",
100
- "serde_magnus",
106
+ "serde_json",
101
107
  "sqlparser",
108
+ "twox-hash",
102
109
  ]
103
110
 
104
111
  [[package]]
@@ -107,6 +114,22 @@ version = "0.3.3"
107
114
  source = "registry+https://github.com/rust-lang/crates.io-index"
108
115
  checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
109
116
 
117
+ [[package]]
118
+ name = "hashbrown"
119
+ version = "0.17.1"
120
+ source = "registry+https://github.com/rust-lang/crates.io-index"
121
+ checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
122
+
123
+ [[package]]
124
+ name = "indexmap"
125
+ version = "2.14.0"
126
+ source = "registry+https://github.com/rust-lang/crates.io-index"
127
+ checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
128
+ dependencies = [
129
+ "equivalent",
130
+ "hashbrown",
131
+ ]
132
+
110
133
  [[package]]
111
134
  name = "itertools"
112
135
  version = "0.13.0"
@@ -116,6 +139,12 @@ dependencies = [
116
139
  "either",
117
140
  ]
118
141
 
142
+ [[package]]
143
+ name = "itoa"
144
+ version = "1.0.18"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
147
+
119
148
  [[package]]
120
149
  name = "lazy_static"
121
150
  version = "1.5.0"
@@ -348,14 +377,17 @@ dependencies = [
348
377
  ]
349
378
 
350
379
  [[package]]
351
- name = "serde_magnus"
352
- version = "0.11.0"
380
+ name = "serde_json"
381
+ version = "1.0.150"
353
382
  source = "registry+https://github.com/rust-lang/crates.io-index"
354
- checksum = "8ff64c88ddd26acdcad5a501f18bcc339927b77b69f4a03bfaf2a6fc5ba2ac4b"
383
+ checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
355
384
  dependencies = [
356
- "magnus",
385
+ "indexmap",
386
+ "itoa",
387
+ "memchr",
357
388
  "serde",
358
- "tap",
389
+ "serde_core",
390
+ "zmij",
359
391
  ]
360
392
 
361
393
  [[package]]
@@ -385,6 +417,18 @@ dependencies = [
385
417
  "log",
386
418
  "recursive",
387
419
  "serde",
420
+ "sqlparser_derive",
421
+ ]
422
+
423
+ [[package]]
424
+ name = "sqlparser_derive"
425
+ version = "0.5.0"
426
+ source = "registry+https://github.com/rust-lang/crates.io-index"
427
+ checksum = "a6dd45d8fc1c79299bfbb7190e42ccbbdf6a5f52e4a6ad98d92357ea965bd289"
428
+ dependencies = [
429
+ "proc-macro2",
430
+ "quote",
431
+ "syn",
388
432
  ]
389
433
 
390
434
  [[package]]
@@ -412,10 +456,10 @@ dependencies = [
412
456
  ]
413
457
 
414
458
  [[package]]
415
- name = "tap"
416
- version = "1.0.1"
459
+ name = "twox-hash"
460
+ version = "2.1.2"
417
461
  source = "registry+https://github.com/rust-lang/crates.io-index"
418
- checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
462
+ checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c"
419
463
 
420
464
  [[package]]
421
465
  name = "unicode-ident"
@@ -437,3 +481,9 @@ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
437
481
  dependencies = [
438
482
  "windows-link",
439
483
  ]
484
+
485
+ [[package]]
486
+ name = "zmij"
487
+ version = "1.0.23"
488
+ source = "registry+https://github.com/rust-lang/crates.io-index"
489
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"