{"id":13493223,"url":"https://github.com/softace/sqliteodbc","last_synced_at":"2025-03-28T11:32:02.623Z","repository":{"id":4622454,"uuid":"5766438","full_name":"softace/sqliteodbc","owner":"softace","description":"SQLite ODBC driver","archived":false,"fork":false,"pushed_at":"2024-03-08T11:54:04.000Z","size":2511,"stargazers_count":112,"open_issues_count":12,"forks_count":34,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-01T19:46:04.284Z","etag":null,"topics":["c","database","odbc","odbc-driver","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"http://www.sqliteodbc.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softace.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"license.terms","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-11T14:41:33.000Z","updated_at":"2024-07-27T13:23:37.000Z","dependencies_parsed_at":"2022-08-10T10:40:11.267Z","dependency_job_id":null,"html_url":"https://github.com/softace/sqliteodbc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softace%2Fsqliteodbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softace%2Fsqliteodbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softace%2Fsqliteodbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softace%2Fsqliteodbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softace","download_url":"https://codeload.github.com/softace/sqliteodbc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222376246,"owners_count":16974312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","database","odbc","odbc-driver","sqlite","sqlite3"],"created_at":"2024-07-31T19:01:13.306Z","updated_at":"2024-10-31T07:31:20.189Z","avatar_url":"https://github.com/softace.png","language":"C","readme":"SQLite ODBC Driver\r\n------------------\r\n\r\nThis is an open source ODBC driver for the wonderful SQLite 2.8.*\r\nand SQLite 3.* Database Engine/Library. The driver is usable but may\r\ncontain bugs. Use it on your own risk.\r\n\r\nThe current source can be downloaded from\r\n\r\n    http://www.ch-werner.de/sqliteodbc/sqliteodbc-*.tar.gz\r\n\r\nWIN32 binaries (the ODBC driver DLL, install/uninstall programs) are in\r\n\r\n    http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe\r\n\r\nThe binaries were made with SQLite 2.8.17, SQLite 3.43.2, MingW\r\ncross compiler and tested on Windows NT 4.0 with the query tool\r\nof MS Excel 97, with StarOffice 5.2 and OpenOffice 1.1 and 2.x.\r\nExecute the sqliteodbc.exe NSIS installer to unpack the necessary\r\nfiles. This installs the SQLite ODBC driver and creates a System DSN.\r\nTo remove the driver use the start menu entries or the UNINST.EXE\r\nprogram. To create a SQLite data source use the ODBC control panel\r\napplet and provide the name of the SQLite database file to be worked\r\non as an absolute pathname including the drive letter, eg as\r\n\"C:\\TEMP\\SQLite.DB\". The busy (or lock) timeout for the database\r\ncan be specified in the respective field. If empty a default value\r\nof 100000 milliseconds is used.\r\n\r\nThe Win64 installer (sqliteodbc_w64.exe) was made with SQLite 3.43.2,\r\nMingW cross compiler and only rudimentary tested on Windows Vista 64.\r\n\r\nOther tests were made on Linux with the \"isql\" command line tool\r\nand the \"DataManager\" GUI tool of unixODBC 2.1.0.\r\n\r\n\r\nSince October 14th, 2001, the driver supports the data types SQL_INTEGER,\r\nSQL_TINYINT, SQL_SMALLINT, SQL_FLOAT, SQL_DOUBLE, SQL_DATE, SQL_TIME,\r\nSQL_TIMESTAMP, and SQL_VARCHAR.\r\n\r\nSince May 25th, 2002, SQL_LONGVARCHAR is available but rather\r\nexperimental. That type is used for SQLite schema containing text\r\nor varchar with a size specifier larger than 255.\r\n\r\nThe data type mapping obtains per-column meta information from the\r\n\"PRAGMA table_info(...)\" SQLite statement. If SELECTs are used which\r\ncontain columns for which the table qualifier cannot be determined,\r\nno meta information for data type mapping is available and therefore\r\nthe database source data type will be SQL_VARCHAR or SQL_LONGVARCHAR\r\nwhich usually maps to SQL_C_CHAR.\r\n\r\nRestrictions of data type mapping:\r\n\r\n- Integer and floating point columns in the database are reported\r\n  as NULLs when no digit seen in the column, otherwise all digits\r\n  up to end of string or non-digit are interpreted as the value,\r\n  i.e. '10blurk' is ten, '0blurk' is zero, but 'blurk' is NULL.\r\n- Format for SQL_DATE is YYYY-MM-DD or YYYYMMDD\r\n- Format for SQL_TIME is hh:mm:ss or hhmmss\r\n- Format for SQL_TIMESTAMP is\r\n      YYYYMMDDhhmmss[fraction]\r\n  or  YYYY-MM-DD hh:mm:ss[.fraction]\r\n  or  hh:mm:ss[.fraction] YYYY-MM-DD\r\n  The fractional part is expressed as 1E-09 seconds\r\n- The driver puts the ODBC string representations for date/time,\r\n  (eg for \"{ts '2001-10-10 12:58:00'}\" the substring within the\r\n  single quotes) directly into the SQLite column\r\n- When the DSN Option \"JDConv\" (Julian Day conversion) is enabled\r\n  the SQLite 3 driver translates floating point column data\r\n  interpreted as Julian Day to/from SQL_DATE, SQL_TIME, and\r\n  SQL_TIMESTAMP data types (supported since May 2013)\r\n\r\nSince November 17th, 2001, configure/libtool is used for the Un*x\r\nversion which should automatically find the SQLite and unixODBC\r\n(or iODBC) header files and libraries. Do the usual\r\n\r\n    $ ./configure \u0026\u0026 make\r\n\r\nfollowed by\r\n\r\n    # make install\r\n\r\nin order to get /usr/local/lib/libsqliteodbc.so.\r\nOf course, you should have installed the unixODBC (or iODBC)\r\ndevelopment RPMs since the ODBC header files are required for\r\nthe build of the SQLite ODBC driver.\r\n\r\nSince May 15th, 2003, (version 0.51), there are two variants\r\nof the SQLite 2.x driver for Win32 platforms: the first (sqliteodbc.dll)\r\nlinked against ISO8859-1 SQLite library exporting ODBC/SQL ANSI\r\nfunctions, and the second (sqliteodbcu.dll) linked against UTF-8\r\nSQLite library exporting ODBC/SQL UNICODE functions.\r\n\r\nThe UNICODE version is experimental and allows to turn off\r\nwide character SQL data types by its configuration dialog\r\n(checkmark labelled \"No WCHAR\"). It is known to work on Win32.\r\nIt may work on UN*X too using newer version of unixODBC.\r\n\r\nTo setup a SQLite data source using unixODBC (www.unixodbc.org):\r\n\r\n  1. Add the driver to /etc/odbcinst.ini:\r\n\r\n    [SQLite]\r\n    Description=SQLite ODBC Driver\r\n    Driver=/usr/local/lib/libsqliteodbc.so\r\n    Setup=/usr/local/lib/libsqliteodbc.so\r\n    Threading=2\r\n\r\n  2. Add a DSN to your private ~/.odbc.ini:\r\n\r\n    [mysqlitedb]\r\n    Description=My SQLite test database\r\n    Driver=SQLite\r\n    Database=/home/johndoe/databases/mytest.db\r\n    # optional lock timeout in milliseconds\r\n    Timeout=2000\r\n\r\nFor iODBC (www.iodbc.org, only versions 3.0.[56] tested) do the\r\nfollowing steps:\r\n\r\n  1. Add the driver to /etc/odbcinst.ini:\r\n\r\n    [ODBC Drivers]\r\n    ...\r\n    SQLite=Installed\r\n    ...\r\n\r\n    [SQLite]\r\n    Driver=/usr/local/lib/libsqliteodbc.so\r\n\r\n  2. Add a DSN to your private ~/.odbc.ini:\r\n\r\n    [ODBC Data Sources]\r\n    ...\r\n    mysqlitedb=SQLite\r\n    ...\r\n\r\n    [mysqlitedb]\r\n    Driver=/usr/local/lib/libsqliteodbc.so\r\n    Description=My SQLite test database\r\n    Database=/home/johndoe/databases/mytest.db\r\n    # optional lock timeout in milliseconds\r\n    Timeout=2000\r\n\r\n\r\nDSN-less connection to the driver\r\n\r\n  Using the SQLDriverConnect() API it is possible to connect to\r\n  a SQLite database with these strings (Win32 and UN*X)\r\n\r\n    DSN={SQLite Datasource};Database=full-path-to-db;...\r\n    DSN={SQLite3 Datasource};Database=full-path-to-db;...\r\n\r\n  alternatively\r\n\r\n  Win32:\r\n\r\n    Driver={SQLite ODBC Driver};Database=full-path-to-db;...\r\n    Driver={SQLite3 ODBC Driver};Database=full-path-to-db;...\r\n\r\n  UN*X (Linux RPM):\r\n\r\n    Driver=SQLITE;Database=full-path-to-db;...\r\n    Driver=SQLITE3;Database=full-path-to-db;...\r\n\r\n\r\nConnect string parameters for DSN-less connects\r\n\r\n  Database (string)\tname of SQLite2/3 database file; default empty\r\n  PWD (string)\t\tpassword when built with SEE support; default empty\r\n  Timeout (integer)\tlock time out in milliseconds; default 100000\r\n  StepAPI (boolean)\tif true, use sqlite[3]_step et.al.; default false\r\n  NoTXN (boolean)\tif true, only pretend transactions; default false\r\n  NoWCHAR (boolean)\tif true, don't support WCHAR types for character\r\n\t\t\tdata; default false\r\n  NoCreat (boolean)\tif true and database file doesn't exist, don't\r\n\t\t\tcreate it automatically; default false, unsupported\r\n\t\t\tfor SQLite2\r\n  LongNames (boolean)\tif true, don't shorten column names; default false\r\n  ShortNames (boolean)\tif true, enforce short column names; default false\r\n  SyncPragma (string)\tvalue for PRAGMA SYNCHRONOUS; default empty\r\n  FKSupport (boolean)\tif true, support SQLite3 foreign key constraints;\r\n\t\t\tdefault false\r\n  JournalMode (string)\tvalue for PRAGMA JOURNAL_MODE; default empty\r\n  OEMCP (boolean)\tWin32 only: if true, translate strings from/to\r\n\t\t\tUTF8 to current code page; default false\r\n  BigInt (boolean)\tif true, force integer columns to SQL_BIGINT;\r\n\t\t\tdefault false\r\n  JDConv (boolean)\tif true, use SQLite3 julian day representation for\r\n\t\t\tSQL_TIME, SQL_TIMESTAMP, SQL_DATE types; default false\r\n  TraceFile (string)\tname of file to write SQLite traces to; default empty\r\n  AttachAs (string)\tSQLite3 only: comma separated names to be the attach\r\n\t\t\tnames to the current database file; default empty\r\n  ILike (boolean)\tSQLite3 only: if true, treat ILIKE as LIKE in SQL\r\n\t\t\tto mimic PostgreSQL syntax; default false \r\n\r\nPython sample usage with eGenix mx-Extension\r\n(see http://www.lemburg.com/files/python/mxODBC.html)\r\n\r\n    $ python\r\n    \u003e\u003e\u003e import mx.ODBC.unixODBC\r\n    \u003e\u003e\u003e dbc=mx.ODBC.unixODBC.connect(\"mysqlitedb\")\r\n    \u003e\u003e\u003e cur=dbc.cursor()\r\n    \u003e\u003e\u003e cur.execute(\"create table foo (id int, name string)\")\r\n    1\r\n    \u003e\u003e\u003e cur.execute(\"insert into foo values(1, 'Me')\")\r\n    1\r\n    \u003e\u003e\u003e cur.execute(\"insert into foo values(2, 'You')\")\r\n    1\r\n    \u003e\u003e\u003e dbc.commit()\r\n    \u003e\u003e\u003e cur.execute(\"select * from foo\")\r\n    \u003e\u003e\u003e print cur.fetchall()\r\n    [(1, 'Me'), (2, 'You')]\r\n    \u003e\u003e\u003e print cur.fetchall()\r\n    []\r\n    \u003e\u003e\u003e cur.execute(\"drop table foo\")\r\n    1\r\n    \u003e\u003e\u003e dbc.commit()\r\n\r\n\r\nBuild instructions for MS Visual C++ 6.0:\r\n  (unsupported, needs manual fiddling makefiles depending on SQLite version)\r\n\r\n... for SQLite 2.x.x\r\n\r\n1. Extract the source tarball sqliteodbc.tar.gz\r\n2. Extract the official SQLite 2.x.x sources in the sqliteodbc\r\n   directory which resulted from step 1. Optionally, apply the\r\n   sqlite-locale-patch-28* which matches your SQLite version\r\n3. Setup your MSVC++ environment, ie PATH/INCLUDE/LIB, then\r\n   open a command window, cd to the sqliteodbc directory and enter:\r\n\r\n        nmake -f sqliteodbc.mak\r\n\r\n   This compiles the SQLite sources first, creates a link library\r\n   of the necessary object files, then compiles and links the ODBC\r\n   driver and the (un)install program.\r\n4. If you'd like to create the UNICODE version of the driver, enter:\r\n\r\n\tnmake -f sqliteodbc.mak clean\r\n\tnmake -f sqliteodbc.mak ENCODING=UTF8\r\n\r\n... for SQLite 3.x.x\r\n\r\n1. Extract the source tarball sqliteodbc.tar.gz\r\n2. Extract the amalgamation SQLite 3.x.x. sources in the sqliteodbc\r\n   directory which resulted from step 1.\r\n3. Setup your MSVC++ environment, ie PATH/INCLUDE/LIB, then\r\n   open a command window, cd to the sqliteodbc directory and enter:\r\n\r\n        nmake -f sqlite3odbc.mak\r\n\r\n   This compiles the amalgamation SQLite3 source and the ODBC driver\r\n   first, then and links the ODBC driver and the (un)install program.\r\n\r\n\r\nNames of Win32 Driver DLLs:\r\n\r\n   sqliteodbc.dll    Driver with ISO8859-1 SQLite2 engine\r\n   sqliteodbcu.dll   Driver with UTF-8/UNICODE SQLite2 engine\r\n   sqlite3odbc.dll   Driver with SQLite3 engine\r\n\r\n\r\nBuild instructions for MingW cross compiler for Win32 targets:\r\n\r\n  A script named mingw-cross-build.sh is provided which contains\r\n  all necessary information. It downloads the required SQLite\r\n  source tarballs and builds SQLite and the ODBC drivers. The\r\n  final step is creating an NSIS installer.\r\n\r\n\r\nBuild instructions for MingW cross compiler for Win64 targets:\r\n\r\n  A script named mingw64-cross-build.sh is provided which contains\r\n  all necessary information. It downloads the required SQLite\r\n  source tarballs and builds SQLite 3 and the ODBC driver. The\r\n  final step is creating an NSIS installer.\r\n\r\n\r\nSpecial build to use System.Data.SQLite on Win32/Win64\r\n\r\n  A variant of the SQLite3 ODBC driver can be build which uses\r\n  internal dynamic linking to System.Data.SQLite.dll or sqlite3.dll.\r\n  This feature is turned on when running the mingw*-cross-build.sh\r\n  scripts with SQLITE_DLLS=2.\r\n\r\n\r\nBuild Instructions for Alpha/Tru64 (OSF1 V5.1) and HP/UX (B.11.23 U ia64)\r\n\r\n  Nikola Radovanovic had success with these commands to build\r\n  all required components:\r\n\r\n  sqlite (3.6.7):\r\n    ./configure --prefix=$HOME/development --disable-tcl \\\r\n      CC='cc -pthread' CFLAGS='-DSQLITE_ENABLE_COLUMN_METADATA=1'\r\n    gmake \u0026\u0026 gmake install\r\n\r\n  unixODBC (2.2.12):\r\n    ./configure --prefix=${HOME}/development --disable-gui \\\r\n      --without-x --enable-iconv=no\r\n    gmake \u0026\u0026 gmake install\r\n\r\n  sqliteodbc (\u003e0.79):\r\n    ./configure --with-sqlite3=${HOME}/development \\\r\n      --with-odbc=${HOME}/development --prefix=${HOME}/development \\\r\n      --enable-winterface=no\r\n    OSF1:  gmake \u0026\u0026 gmake install\r\n    HP/UX: gmake CFLAGS=\"+DD64\" \u0026\u0026 gmake install\r\n\r\n\r\nBuild Instructions for RPM based systems\r\n\r\n  rpmbuild -tb sqliteodbc-*.tar.gz\r\n\r\n\r\nBuild Instructions for Debian based systems\r\n\r\n  tar xzf sqliteodbc-*.tar.gz\r\n  cd sqliteodbc-*\r\n  ./configure \u0026\u0026 make deb\r\n\r\n\r\nWin32 install/remove using RUNDLL32\r\n\r\n  Each driver DLL provides entry points for ODBC driver installation\r\n  and removal which can be invoked from RUNDLL32.EXE, eg\r\n\r\n  ### install sqliteodbc.dll\r\n  C:\\\u003e RUNDLL32 [path]sqliteodbc.dll,install [quiet]\r\n\r\n  ### remove sqlite3odbc.dll\r\n  C:\\\u003e RUNDLL32 [path]sqlite3odbc.dll,uninstall [quiet]\r\n\r\n  If [path] is not provided newer Windows OSes tend to favor the\r\n  sqlite*odbc*dll in system directories over the current directory,\r\n  thus better provide an absolute path to the DLL of interest.\r\n  If the word \"quiet\" appears anywhere after the DLL/function\r\n  name, no info message boxes pop up (but errors are shown).\r\n\r\nWin64 notes\r\n\r\n  On Win64 (64 bit versions of Vista, Windows 7 ...) both 32 bit and 64 bit\r\n  drivers can be installed in parallel. The 32 bit drivers are required\r\n  when using 32 bit applications. In order to manage 32 bit data\r\n  sources, the 32 bit ODBC admin tool C:\\Windows\\SysWOW64\\odbcad32.exe\r\n  must be used.\r\n\r\n\r\nMacOSX notes (thanks Steve Palm)\r\n\r\n  The driver requires that you have ODBC installed and set up on\r\n  your Mac. Some GUI tools are here:\r\n\r\n    http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads\r\n    http://www.odbcmanager.net\r\n\r\n  The ODBC configuration files can be edited manually as on Linux.\r\n  The files are at:\r\n\r\n    /Library/ODBC/odbc.ini\r\n    /Library/ODBC/odbcinst.ini\r\n\r\n  Example for odbc.ini:\r\n\r\n    [ODBC Data Sources]\r\n    Mail            = SQLite3 Driver\r\n\r\n    [Mail]\r\n    Driver      = /usr/local/lib/libsqlite3odbc.dylib\r\n    Description = OSX Mail Database\r\n    database    = /Users/n9yty/Library/Mail/V3/MailData/Envelope Index\r\n\r\n  Example for odbcinst.ini\r\n\r\n    [ODBC Drivers]\r\n    SQLite3 Driver        = Installed\r\n\r\n    [SQLite3 Driver]\r\n    Driver = /usr/local/lib/libsqlite3odbc.dylib\r\n    Setup  = /usr/local/lib/libsqlite3odbc.dylib\r\n\r\n  The iODBC driver manages provides the utility programs iodbctest\r\n  and iodbctestw (UNICODE) which can be run in Terminal to verify\r\n  the installed data sources.\r\n\r\n\r\nTODO:\r\n\r\n- improve documentation\r\n\r\n\r\n2023-10-23\r\nChristian Werner\r\nmailto:chw@ch-werner.de\r\n\r\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftace%2Fsqliteodbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftace%2Fsqliteodbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftace%2Fsqliteodbc/lists"}