File Extensions for Data Base…

  1. 2 weeks ago

    Emile S

    Sep 8 Europe (France, Strasbourg)

    …or How do I get the data base kind from the file (name, something else) ?

    In other words, I want to display information about data base and I am stopped at how do I recognize what DB engine is the owner of this file ?

    I can deduce that information from the SQLite file extension (if set to .sqlite, otherwise I do not know).

    I am out of ideas. I searched here, there and everywhere in the internet and I do not found the beginning of an idea.

    And You ?

  2. Dave S

    Sep 8 San Diego, California USA

    never rely on the name or extension.... they no longer have the same strict meanings as in days past.

    an SQLite database for example can have any (or no) extension.

    Either open the file as a binary stream and look for key values, or just attempt to "use" the file and catch any exceptions

  3. Tanner L

    is not verified Sep 8 Pre-Release Testers Toronto, Canada

    @Emile S …or How do I get the data base kind from the file (name, something else) ?

    On Mac you can use the file command. More info at https://ss64.com/osx/file.html .

  4. last week

    Emile S

    Sep 9 Europe (France, Strasbourg)

    @Dave S an SQLite database for example can have any (or no) extension.

    Lack of rules, I was fearing that…

    Thanks for the answers.

    For SQLite, there is a magic key (actual value: SQLite format 3\000), but in other dbs ?

    BTW: is it possible (like with SQLite) to create local DB files with PostGreSQL and other Xojo built-in Data Bases ? (if so, I can explore closely their files) ?

  5. Dave S

    Sep 9 San Diego, California USA

    FYI..... an encrypted SQLIte database has no "magic key " or orther method of ID.... and the FILE command reports it as "DATA"

  6. @Emile S — Well only SQLite databases have a single file for the whole database. Other databases can be spread over several locations (foldersà and you should not attempt to access them!

  7. Emile S

    Sep 9 Europe (France, Strasbourg)

    Doh !

    This is why we need rules, I suppose.

    Thank you guys…

  8. Norman P

    Sep 9 Pre-Release Testers, Xojo Pro great-white-software.com/blog

    oh I'm sure there are others besides sqlite
    firebird and Filemaker can both be single file
    Not sure they are always single file though

  9. Emile S

    Sep 10 Europe (France, Strasbourg)
    Edited last week

    Here’s what I implemented (displays SQLite db files / Icon) / have in mind:

    display the kind of Data Base,
    display the icon for that Data Base (red feather for SQLite),

    The Listbox is populated at Open time from a dedicated Folder, the PopupMenu displays the number of Records (19) and the TABLE name.

    That window is a work in progress.

    -image-

  10. Tim S

    Sep 10 Canterbury, UK

    @Emile S …or How do I get the data base kind from the file (name, something else) ?

    I can deduce that information from the SQLite file extension (if set to .sqlite, otherwise I do not know).

    None of my sqlite databases has any extension at all.

  11. Emile S

    Sep 10 Europe (France, Strasbourg)

    There are even people who change the file extentions claiming they change the kind of file (from avi to moov; do not laugh, I heard it !).

    That said, I created “my file extension” for sqlite db data file 6,5 years ago (bad idea).

    My Lenovo (bouhhhhh) laptop never display any file extension in 4 years (then gone to repair and comes back (from factory plant) with broken Touch Screen: I will never brought anything from them anymore !

or Sign Up to reply!