Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/madushadhanushka/simple-sqlite
Code reading for sqlite backend
https://github.com/madushadhanushka/simple-sqlite
database sqlite
Last synced: about 2 months ago
JSON representation
Code reading for sqlite backend
- Host: GitHub
- URL: https://github.com/madushadhanushka/simple-sqlite
- Owner: madushadhanushka
- License: gpl-2.0
- Created: 2018-11-18T06:41:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T13:41:26.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T22:43:18.709Z (5 months ago)
- Topics: database, sqlite
- Language: C
- Homepage:
- Size: 42 KB
- Stars: 386
- Watchers: 11
- Forks: 64
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CMake](https://github.com/madushadhanushka/simple-sqlite/actions/workflows/cmake.yml/badge.svg)](https://github.com/madushadhanushka/simple-sqlite/actions/workflows/cmake.yml)
Simple SQLite Backend
=========
This repository is to understand the basic backend implementation of SQLite database. Codes are extracted from SQLite 2.5.0 version and initial implementation may have changed. Here, testing codes are added into the test directory and all SQLite implementation are included into the core directory. Tests included to test VFS, Pager and Btree functionality.## Reading materials
[Introduction to the indexing and Btree](https://github.com/madushadhanushka/simple-sqlite/blob/master/blog/introduction_to_btree_and_bplustree.md)[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/bOFlJ0oUjU4/0.jpg)](https://www.youtube.com/watch?v=bOFlJ0oUjU4)
Compile and running instructions for Unix
======1. Take a clone of this project into your local folder
`git clone https://github.com/madushadhanushka/simple-sqlite.git`
2. Move inside the repository
`cd simple-sqlite`
3. Build the project with cmake
`cmake -DCMAKE_BUILD_TYPE=Debug`
4. Build with make
`make`
5. Run test
`./simple_sqlite`Use as your own Paging library
========
You can use paging functionality to create your own file accessing implementation. You can find out sample usecase in [pager.c](https://github.com/madushadhanushka/simple-sqlite/blob/master/test/pagetest.c).Open pager with the given file name
`int sqlitepager_open(Pager **ppPager,const char *zFilename,int nPage,int nEx);`Get page specified by the page number
`int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage);`Start to write data into a page specified in pData
`int sqlitepager_write(void *pData);`Commit page changes into the file
`int sqlitepager_commit(Pager*);`Close the connection to the file
`int sqlitepager_close(Pager *pPager);`Contribute!
===========
If you see somthing wrong, Inclomplete content or improvement, you are welcome to create issue or send pull request to this repository in order to improve the code quality and the readability.Following are the top contributors of this repository. Keep coding! 👨🏻💻👩🏻💻