dissect.sql
Advanced tools
| Metadata-Version: 2.4 | ||
| Name: dissect.sql | ||
| Version: 3.12.dev3 | ||
| Version: 3.12.dev4 | ||
| Summary: A Dissect module implementing a parsers for the SQLite database file format, commonly used by applications to store configuration data | ||
@@ -5,0 +5,0 @@ Author-email: Dissect Team <dissect@fox-it.com> |
@@ -94,3 +94,3 @@ from __future__ import annotations | ||
| if column_name.upper().startswith( | ||
| if "(" in column_def and column_name.upper().startswith( | ||
| ( | ||
@@ -97,0 +97,0 @@ "CONSTRAINT", |
+1
-1
| Metadata-Version: 2.4 | ||
| Name: dissect.sql | ||
| Version: 3.12.dev3 | ||
| Version: 3.12.dev4 | ||
| Summary: A Dissect module implementing a parsers for the SQLite database file format, commonly used by applications to store configuration data | ||
@@ -5,0 +5,0 @@ Author-email: Dissect Team <dissect@fox-it.com> |
+56
-8
@@ -8,3 +8,3 @@ from __future__ import annotations | ||
| testdata = [ | ||
| ( | ||
| pytest.param( | ||
| "CREATE TABLE foo (column1, column2 INTEGER NOT NULL PRIMARY KEY)", | ||
@@ -19,4 +19,5 @@ ( | ||
| ), | ||
| id="create-table-simple", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| "CREATE TABLE something (\n column1 INTEGER NOT NULL,\n column2 INTEGER NOT NULL,\n" | ||
@@ -35,4 +36,5 @@ "value,\n PRIMARY KEY ( column1, column2)\n);", | ||
| ), | ||
| id="create-table-constraint-pk", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| "GaRbAgE FoOoOoO ( \n\tcolumn1\n\tsome expression (with (nested (braces))), " | ||
@@ -50,4 +52,5 @@ "column2 (()), CONSTRAINT (with( some\n(braces\n)\n))\n)", | ||
| ), | ||
| id="create-table-nested-braces", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| "CREATE TABLE bar (column1, column2 INTEGER NOT NULL, PRIMARY KEY ( column2 ))", | ||
@@ -64,4 +67,5 @@ ( | ||
| ), | ||
| id="create-table-empty-column-constraint-pk", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| "CREATE TABLE bla (column1, column2 INTEGER NOT NULL, PRIMARY KEY ( column1, column2 ))", | ||
@@ -78,4 +82,5 @@ ( | ||
| ), | ||
| id="create-table-empty-column-constraint-multiple-pk", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| "CREATE TABLE bla (userId, test, UNIQUE(userId, test))", | ||
@@ -92,4 +97,5 @@ ( | ||
| ), | ||
| id="create-table-unique-constraint", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| "CREATE TABLE something (\n column1, -- comment\n column2\n)", | ||
@@ -104,4 +110,5 @@ ( | ||
| ), | ||
| id="create-table-newline-comments", | ||
| ), | ||
| ( | ||
| pytest.param( | ||
| 'CREATE TABLE foo (\n "column-1",\n "column--2", -- comment\n "column-`-\'-3" -- comment, "column-\\"4"\n)', | ||
@@ -117,3 +124,44 @@ ( | ||
| ), | ||
| id="create-table-newline-comments-quotes-backticks", | ||
| ), | ||
| # Windows Index database | ||
| pytest.param( | ||
| "CREATE TABLE TableName (Id INTEGER PRIMARY KEY, UniqueKey TEXT NOT NULL UNIQUE, Name TEXT NOT NULL)", | ||
| ( | ||
| "Id", | ||
| [ | ||
| ("Id", "INTEGER PRIMARY KEY"), | ||
| ("UniqueKey", "TEXT NOT NULL UNIQUE"), # <- this should not end up in the constraints list | ||
| ("Name", "TEXT NOT NULL"), | ||
| ], | ||
| [], | ||
| ), | ||
| id="create-table-unique-in-column-name", | ||
| ), | ||
| # Mozilla Firefox moz_places | ||
| pytest.param( | ||
| "CREATE TABLE moz_places ( id INTEGER PRIMARY KEY, url LONGVARCHAR, title LONGVARCHAR, rev_host LONGVARCHAR, visit_count INTEGER DEFAULT 0, hidden INTEGER DEFAULT 0 NOT NULL, typed INTEGER DEFAULT 0 NOT NULL, frecency INTEGER DEFAULT -1 NOT NULL, last_visit_date INTEGER , guid TEXT, foreign_count INTEGER DEFAULT 0 NOT NULL, url_hash INTEGER DEFAULT 0 NOT NULL , description TEXT, preview_image_url TEXT, origin_id INTEGER REFERENCES moz_origins(id))", # noqa: E501 | ||
| ( | ||
| "id", | ||
| [ | ||
| ("id", "INTEGER PRIMARY KEY"), | ||
| ("url", "LONGVARCHAR"), | ||
| ("title", "LONGVARCHAR"), | ||
| ("rev_host", "LONGVARCHAR"), | ||
| ("visit_count", "INTEGER DEFAULT 0"), | ||
| ("hidden", "INTEGER DEFAULT 0 NOT NULL"), | ||
| ("typed", "INTEGER DEFAULT 0 NOT NULL"), | ||
| ("frecency", "INTEGER DEFAULT -1 NOT NULL"), | ||
| ("last_visit_date", "INTEGER"), | ||
| ("guid", "TEXT"), | ||
| ("foreign_count", "INTEGER DEFAULT 0 NOT NULL"), # <- this should not end up in the constraints list | ||
| ("url_hash", "INTEGER DEFAULT 0 NOT NULL"), | ||
| ("description", "TEXT"), | ||
| ("preview_image_url", "TEXT"), | ||
| ("origin_id", "INTEGER REFERENCES moz_origins(id)"), | ||
| ], | ||
| [], | ||
| ), | ||
| id="create-table-firefox-foreign-in-column-name", | ||
| ), | ||
| ] | ||
@@ -120,0 +168,0 @@ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
109991
2.32%1064
4.83%