{"id":26571888,"url":"https://github.com/adwaith-rajesh/sqlite3","last_synced_at":"2026-02-17T06:04:38.083Z","repository":{"id":283882283,"uuid":"953188915","full_name":"Adwaith-Rajesh/sqlite3","owner":"Adwaith-Rajesh","description":"time to snoop around Sqlite","archived":false,"fork":false,"pushed_at":"2025-03-23T14:11:32.000Z","size":204323,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-12-22T07:46:43.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Adwaith-Rajesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-22T19:16:01.000Z","updated_at":"2025-03-23T14:11:37.000Z","dependencies_parsed_at":"2025-06-02T07:22:25.835Z","dependency_job_id":null,"html_url":"https://github.com/Adwaith-Rajesh/sqlite3","commit_stats":null,"previous_names":["adwaith-rajesh/sqlite3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Adwaith-Rajesh/sqlite3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2Fsqlite3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2Fsqlite3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2Fsqlite3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2Fsqlite3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adwaith-Rajesh","download_url":"https://codeload.github.com/Adwaith-Rajesh/sqlite3/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adwaith-Rajesh%2Fsqlite3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29535934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-03-22T23:17:17.317Z","updated_at":"2026-02-17T06:04:38.065Z","avatar_url":"https://github.com/Adwaith-Rajesh.png","language":"C","readme":"\u003ch1 align=\"center\"\u003eSQLite Source Repository\u003c/h1\u003e\n\nThis repository contains the complete source code for the\n[SQLite database engine](https://sqlite.org/).  Some test scripts\nare also included.  However, many other test scripts\nand most of the documentation are managed separately.\n\n## Version Control\n\nSQLite sources are managed using\n[Fossil](https://www.fossil-scm.org/), a distributed version control system\nthat was specifically designed and written to support SQLite development.\nThe [Fossil repository](https://sqlite.org/src/timeline) contains the urtext.\n\nIf you are reading this on GitHub or some other Git repository or service,\nthen you are looking at a mirror.  The names of check-ins and\nother artifacts in a Git mirror are different from the official\nnames for those objects.  The official names for check-ins are\nfound in a footer on the check-in comment for authorized mirrors.\nThe official check-in name can also be seen in the `manifest.uuid` file\nin the root of the tree.  Always use the official name, not  the\nGit-name, when communicating about an SQLite check-in.\n\nIf you pulled your SQLite source code from a secondary source and want to\nverify its integrity, there are hints on how to do that in the\n[Verifying Code Authenticity](#vauth) section below.\n\n## Contacting The SQLite Developers\n\nThe preferred way to ask questions or make comments about SQLite or to\nreport bugs against SQLite is to visit the \n[SQLite Forum](https://sqlite.org/forum) at \u003chttps://sqlite.org/forum/\u003e.\nAnonymous postings are permitted.\n\nIf you think you have found a bug that has security implications and\nyou do not want to report it on the public forum, you can send a private\nemail to drh at sqlite dot org.\n\n## Public Domain\n\nThe SQLite source code is in the public domain.  See\n\u003chttps://sqlite.org/copyright.html\u003e for details. \n\nBecause SQLite is in the public domain, we do not normally accept pull\nrequests, because if we did take a pull request, the changes in that\npull request might carry a copyright and the SQLite source code would\nthen no longer be fully in the public domain.\n\n## Obtaining The SQLite Source Code\n\nIf you do not want to use Fossil, you can download tarballs or ZIP\narchives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows:\n\n  *  Latest trunk check-in as\n     [Tarball](https://www.sqlite.org/src/tarball/sqlite.tar.gz),\n     [ZIP-archive](https://www.sqlite.org/src/zip/sqlite.zip), or\n     [SQLite-archive](https://www.sqlite.org/src/sqlar/sqlite.sqlar).\n\n  *  Latest release as\n     [Tarball](https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release),\n     [ZIP-archive](https://www.sqlite.org/src/zip/sqlite.zip?r=release), or\n     [SQLite-archive](https://www.sqlite.org/src/sqlar/sqlite.sqlar?r=release).\n\n  *  For other check-ins, substitute an appropriate branch name or\n     tag or hash prefix in place of \"release\" in the URLs of the previous\n     bullet.  Or browse the [timeline](https://www.sqlite.org/src/timeline)\n     to locate the check-in desired, click on its information page link,\n     then click on the \"Tarball\" or \"ZIP Archive\" links on the information\n     page.\n\nIf you do want to use Fossil to check out the source tree,\nfirst install Fossil version 2.0 or later.\n(Source tarballs and precompiled binaries available\n[here](https://www.fossil-scm.org/fossil/uv/download.html).  Fossil is\na stand-alone program.  To install, simply download or build the single\nexecutable file and put that file someplace on your $PATH.)\nThen run commands like this:\n\n        mkdir -p ~/sqlite ~/Fossils\n        cd ~/sqlite\n        fossil clone https://www.sqlite.org/src ~/Fossils/sqlite.fossil\n        fossil open ~/Fossils/sqlite.fossil\n\nAfter setting up a repository using the steps above, you can always\nupdate to the latest version using:\n\n        fossil update trunk   ;# latest trunk check-in\n        fossil update release ;# latest official release\n\nOr type \"fossil ui\" to get a web-based user interface.\n\n## Compiling for Unix-like systems\n\nFirst create a directory in which to place\nthe build products.  It is recommended, but not required, that the\nbuild directory be separate from the source directory.  Cd into the\nbuild directory and then from the build directory run the configure\nscript found at the root of the source tree.  Then run \"make\".\n\nFor example:\n\n        tar xzf sqlite.tar.gz    ;#  Unpack the source tree into \"sqlite\"\n        mkdir bld                ;#  Build will occur in a sibling directory\n        cd bld                   ;#  Change to the build directory\n        ../sqlite/configure      ;#  Run the configure script\n        make                     ;#  Builds the \"sqlite3\" command-line tool\n        make sqlite3.c           ;#  Build the \"amalgamation\" source file\n        make devtest             ;#  Run some tests (requires Tcl)\n\nSee the makefile for additional targets.\n\nThe configure script uses autoconf 2.61 and libtool.  If the configure\nscript does not work out for you, there is a generic makefile named\n\"Makefile.linux-gcc\" in the top directory of the source tree that you\ncan copy and edit to suit your needs.  Comments on the generic makefile\nshow what changes are needed.\n\n## Compiling for Windows Using MSVC\n\nOn Windows, all applicable build products can be compiled with MSVC.\nYou will also need a working installation of TCL.\nSee the [compile-for-windows.md](doc/compile-for-windows.md) document for\nadditional information about how to install MSVC and TCL and configure your\nbuild environment.\n\nIf you want to run tests, you need to let SQLite know the location of your\nTCL library, using a command like this:\n\n        set TCLDIR=c:\\Tcl\n\nSQLite uses \"tclsh.exe\" as part of the build process, and so that utility\nprogram will need to be somewhere on your %PATH%.  The finished SQLite library\ndoes not contain any TCL code, but it does use TCL to help with the build process\nand to run tests.\n\nBuild using Makefile.msc.  Example:\n\n        nmake /f Makefile.msc\n        nmake /f Makefile.msc sqlite3.c\n        nmake /f Makefile.msc devtest\n        nmake /f Makefile.msc releasetest\n \nThere are many other makefile targets.  See comments in Makefile.msc for\ndetails.\n\n## Source Code Tour\n\nMost of the core source files are in the **src/** subdirectory.  The\n**src/** folder also contains files used to build the \"testfixture\" test\nharness. The names of the source files used by \"testfixture\" all begin\nwith \"test\".\nThe **src/** also contains the \"shell.c\" file\nwhich is the main program for the \"sqlite3.exe\"\n[command-line shell](https://sqlite.org/cli.html) and\nthe \"tclsqlite.c\" file which implements the\n[Tcl bindings](https://sqlite.org/tclsqlite.html) for SQLite.\n(Historical note:  SQLite began as a Tcl\nextension and only later escaped to the wild as an independent library.)\n\nTest scripts and programs are found in the **test/** subdirectory.\nAdditional test code is found in other source repositories.\nSee [How SQLite Is Tested](http://www.sqlite.org/testing.html) for\nadditional information.\n\nThe **ext/** subdirectory contains code for extensions.  The\nFull-text search engine is in **ext/fts3**.  The R-Tree engine is in\n**ext/rtree**.  The **ext/misc** subdirectory contains a number of\nsmaller, single-file extensions, such as a REGEXP operator.\n\nThe **tool/** subdirectory contains various scripts and programs used\nfor building generated source code files or for testing or for generating\naccessory programs such as \"sqlite3_analyzer(.exe)\".\n\n### Generated Source Code Files\n\nSeveral of the C-language source files used by SQLite are generated from\nother sources rather than being typed in manually by a programmer.  This\nsection will summarize those automatically-generated files.  To create all\nof the automatically-generated files, simply run \"make target\u0026#95;source\".\nThe \"target\u0026#95;source\" make target will create a subdirectory \"tsrc/\" and\nfill it with all the source files needed to build SQLite, both\nmanually-edited files and automatically-generated files.\n\nThe SQLite interface is defined by the **sqlite3.h** header file, which is\ngenerated from src/sqlite.h.in, ./manifest.uuid, and ./VERSION.  The\n[Tcl script](http://www.tcl.tk) at tool/mksqlite3h.tcl does the conversion.\nThe manifest.uuid file contains the SHA3 hash of the particular check-in\nand is used to generate the SQLITE\\_SOURCE\\_ID macro.  The VERSION file\ncontains the current SQLite version number.  The sqlite3.h header is really\njust a copy of src/sqlite.h.in with the source-id and version number inserted\nat just the right spots. Note that comment text in the sqlite3.h file is\nused to generate much of the SQLite API documentation.  The Tcl scripts\nused to generate that documentation are in a separate source repository.\n\nThe SQL language parser is **parse.c** which is generated from a grammar in\nthe src/parse.y file.  The conversion of \"parse.y\" into \"parse.c\" is done\nby the [lemon](./doc/lemon.html) LALR(1) parser generator.  The source code\nfor lemon is at tool/lemon.c.  Lemon uses the tool/lempar.c file as a\ntemplate for generating its parser.\nLemon also generates the **parse.h** header file, at the same time it\ngenerates parse.c.\n\nThe **opcodes.h** header file contains macros that define the numbers\ncorresponding to opcodes in the \"VDBE\" virtual machine.  The opcodes.h\nfile is generated by scanning the src/vdbe.c source file.  The\nTcl script at ./mkopcodeh.tcl does this scan and generates opcodes.h.\nA second Tcl script, ./mkopcodec.tcl, then scans opcodes.h to generate\nthe **opcodes.c** source file, which contains a reverse mapping from\nopcode-number to opcode-name that is used for EXPLAIN output.\n\nThe **keywordhash.h** header file contains the definition of a hash table\nthat maps SQL language keywords (ex: \"CREATE\", \"SELECT\", \"INDEX\", etc.) into\nthe numeric codes used by the parse.c parser.  The keywordhash.h file is\ngenerated by a C-language program at tool mkkeywordhash.c.\n\nThe **pragma.h** header file contains various definitions used to parse\nand implement the PRAGMA statements.  The header is generated by a\nscript **tool/mkpragmatab.tcl**. If you want to add a new PRAGMA, edit\nthe **tool/mkpragmatab.tcl** file to insert the information needed by the\nparser for your new PRAGMA, then run the script to regenerate the\n**pragma.h** header file.\n\n### The Amalgamation\n\nAll of the individual C source code and header files (both manually-edited\nand automatically-generated) can be combined into a single big source file\n**sqlite3.c** called \"the amalgamation\".  The amalgamation is the recommended\nway of using SQLite in a larger application.  Combining all individual\nsource code files into a single big source code file allows the C compiler\nto perform more cross-procedure analysis and generate better code.  SQLite\nruns about 5% faster when compiled from the amalgamation versus when compiled\nfrom individual source files.\n\nThe amalgamation is generated from the tool/mksqlite3c.tcl Tcl script.\nFirst, all of the individual source files must be gathered into the tsrc/\nsubdirectory (using the equivalent of \"make target_source\") then the\ntool/mksqlite3c.tcl script is run to copy them all together in just the\nright order while resolving internal \"#include\" references.\n\nThe amalgamation source file is more than 200K lines long.  Some symbolic\ndebuggers (most notably MSVC) are unable to deal with files longer than 64K\nlines.  To work around this, a separate Tcl script, tool/split-sqlite3c.tcl,\ncan be run on the amalgamation to break it up into a single small C file\ncalled **sqlite3-all.c** that does #include on about seven other files\nnamed **sqlite3-1.c**, **sqlite3-2.c**, ..., **sqlite3-7.c**.  In this way,\nall of the source code is contained within a single translation unit so\nthat the compiler can do extra cross-procedure optimization, but no\nindividual source file exceeds 32K lines in length.\n\n## How It All Fits Together\n\nSQLite is modular in design.\nSee the [architectural description](http://www.sqlite.org/arch.html)\nfor details. Other documents that are useful in\n(helping to understand how SQLite works include the\n[file format](http://www.sqlite.org/fileformat2.html) description,\nthe [virtual machine](http://www.sqlite.org/opcode.html) that runs\nprepared statements, the description of\n[how transactions work](http://www.sqlite.org/atomiccommit.html), and\nthe [overview of the query planner](http://www.sqlite.org/optoverview.html).\n\nYears of effort have gone into optimizing SQLite, both\nfor small size and high performance.  And optimizations tend to result in\ncomplex code.  So there is a lot of complexity in the current SQLite\nimplementation.  It will not be the easiest library in the world to hack.\n\nKey files:\n\n  *  **sqlite.h.in** - This file defines the public interface to the SQLite\n     library.  Readers will need to be familiar with this interface before\n     trying to understand how the library works internally.\n\n  *  **sqliteInt.h** - this header file defines many of the data objects\n     used internally by SQLite.  In addition to \"sqliteInt.h\", some\n     subsystems have their own header files.\n\n  *  **parse.y** - This file describes the LALR(1) grammar that SQLite uses\n     to parse SQL statements, and the actions that are taken at each step\n     in the parsing process.\n\n  *  **vdbe.c** - This file implements the virtual machine that runs\n     prepared statements.  There are various helper files whose names\n     begin with \"vdbe\".  The VDBE has access to the vdbeInt.h header file\n     which defines internal data objects.  The rest of SQLite interacts\n     with the VDBE through an interface defined by vdbe.h.\n\n  *  **where.c** - This file (together with its helper files named\n     by \"where*.c\") analyzes the WHERE clause and generates\n     virtual machine code to run queries efficiently.  This file is\n     sometimes called the \"query optimizer\".  It has its own private\n     header file, whereInt.h, that defines data objects used internally.\n\n  *  **btree.c** - This file contains the implementation of the B-Tree\n     storage engine used by SQLite.  The interface to the rest of the system\n     is defined by \"btree.h\".  The \"btreeInt.h\" header defines objects\n     used internally by btree.c and not published to the rest of the system.\n\n  *  **pager.c** - This file contains the \"pager\" implementation, the\n     module that implements transactions.  The \"pager.h\" header file\n     defines the interface between pager.c and the rest of the system.\n\n  *  **os_unix.c** and **os_win.c** - These two files implement the interface\n     between SQLite and the underlying operating system using the run-time\n     pluggable VFS interface.\n\n  *  **shell.c.in** - This file is not part of the core SQLite library.  This\n     is the file that, when linked against sqlite3.a, generates the\n     \"sqlite3.exe\" command-line shell.  The \"shell.c.in\" file is transformed\n     into \"shell.c\" as part of the build process.\n\n  *  **tclsqlite.c** - This file implements the Tcl bindings for SQLite.  It\n     is not part of the core SQLite library.  But as most of the tests in this\n     repository are written in Tcl, the Tcl language bindings are important.\n\n  *  **test\\*.c** - Files in the src/ folder that begin with \"test\" go into\n     building the \"testfixture.exe\" program.  The testfixture.exe program is\n     an enhanced Tcl shell.  The testfixture.exe program runs scripts in the\n     test/ folder to validate the core SQLite code.  The testfixture program\n     (and some other test programs too) is built and run when you type\n     \"make test\".\n\nThere are many other source files.  Each has a succinct header comment that\ndescribes its purpose and role within the larger system.\n\n\u003ca name=\"vauth\"\u003e\u003c/a\u003e\n## Verifying Code Authenticity\n\nThe `manifest` file at the root directory of the source tree\ncontains either a SHA3-256 hash or a SHA1 hash\nfor every source file in the repository.\nThe name of the version of the entire source tree is just the\nSHA3-256 hash of the `manifest` file itself, possibly with the\nlast line of that file omitted if the last line begins with\n\"`# Remove this line`\".\nThe `manifest.uuid` file should contain the SHA3-256 hash of the\n`manifest` file. If all of the above hash comparisons are correct, then\nyou can be confident that your source tree is authentic and unadulterated.\nDetails on the format for the `manifest` files are available\n[on the Fossil website](https://fossil-scm.org/fossil/doc/trunk/www/fileformat.wiki#manifest).\n\nThe process of checking source code authenticity is automated by the \nmakefile:\n\n\u003e   make verify-source\n\nOr on windows:\n\n\u003e   nmake /f Makefile.msc verify-source\n\nUsing the makefile to verify source integrity is good for detecting\naccidental changes to the source tree, but malicious changes could be\nhidden by also modifying the makefiles.\n\n## Contacts\n\nThe main SQLite website is [http:/sqlite.org/](http://sqlite.org/)\nwith geographically distributed backups at\n[http://www2.sqlite.org/](http://www2.sqlite.org) and\n[http://www3.sqlite.org/](http://www3.sqlite.org).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwaith-rajesh%2Fsqlite3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadwaith-rajesh%2Fsqlite3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwaith-rajesh%2Fsqlite3/lists"}