From 56ddd6b19c38005061d2ab32032d34516f1f6946 Mon Sep 17 00:00:00 2001 From: jjfeldcher <12982997+jjfeldcher@users.noreply.github.com> Date: Mon, 25 Aug 2025 19:01:48 -0600 Subject: [PATCH] added sqlite3 database format --- src/index.spec.ts | 6 ++++++ src/model/pattern-tree.ts | 12 ++++++++++++ src/testfiles/a.sqlite | Bin 0 -> 8192 bytes 3 files changed, 18 insertions(+) create mode 100644 src/testfiles/a.sqlite diff --git a/src/index.spec.ts b/src/index.spec.ts index 86bbd76..92139bd 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -294,6 +294,12 @@ describe("Tests the public API", () => { }); }) + it("detects sqlite (SQLite 3 database file)", () => { + const file = getBytes("a.sqlite") + const result = filetypemime(file); + expect(result).toContain("application/vnd.sqlite3"); + }); + it("detects pdf (Libreoffice export)", () => { // File created using libreoffice writter export to pdf const file = getBytes("a.pdf"); diff --git a/src/model/pattern-tree.ts b/src/model/pattern-tree.ts index b69d472..2fc7599 100644 --- a/src/model/pattern-tree.ts +++ b/src/model/pattern-tree.ts @@ -1335,6 +1335,18 @@ add("Mach-O", ["0xFE", "0xED", "0xFA", "0xCF"], { extension: "elf", }); +add("sqlite", ["0x53","0x51","0x4C","0x69","0x74","0x65","0x20","0x66","0x6F","0x72","0x6D","0x61","0x74","0x20","0x33","0x00"], +{ + mime: "application/vnd.sqlite3", + extension: ".sqlite", +}); + +add("sqlite", ["0x53","0x51","0x4C","0x69","0x74","0x65","0x20","0x66","0x6F","0x72","0x6D","0x61","0x74","0x20","0x33","0x00"], +{ + mime: "application/vnd.sqlite3", + extension: ".sqlite3", +}); + add( "EML", ["0x52", "0x65", "0x63", "0x65", "0x69", "0x76", "0x65", "0x64", "0x3A"], diff --git a/src/testfiles/a.sqlite b/src/testfiles/a.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a5cbc3c05dee298d201bbcad9efff90e0b6ca717 GIT binary patch literal 8192 zcmeI%u?oU45C-5&6*tjA=z61q=->-jB}l1?)(kpUO|cLy)_}g3Z{<@MtGkX4|B>7! z;UMsBA*Ej;S&MBR0X#+}?iKmY;| zfB*y_009U<00Izz00bcLn?NLLzVC~xO}0j#a;q<8^2V_Ylw=i*rjpB}cDCnmuH;0< zyokeD5N|k=n=V^@v#jJ=b>46D2Q?nQU5+jYKmY;|fB*y_009U<00Izz00jP7pd~8Q RKWJlePK*4=m$Pv{|4-0BC(!@^ literal 0 HcmV?d00001