You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,16 @@ Also shown below is the wiring between ESP-WROOM-32 breakout board and Micro SD
8
8
9
9

10
10
11
+
## Why Sqlite on ESP8266 is exciting?
12
+
13
+
[Sqlite3](http://sqlite.org) is the favourite database of all that is portable and widely used. Availability on ESP32 platform makes it even more portable. Sqlite can handle terrabyte sized data, ACID compliant and guaranteed to be stable.
14
+
15
+
So far IoT systems could offer SD Card access, which enabled gigabyte size files accessible, but was not fully utilized because the libraries that were available so far (such as [Arduino Extended Database Library](https://github.com/jwhiddon/EDB) or [SimpleDB](http://www.kendziorra.nl/arduino/103-simpledb-simple-flexible-and-smal)) offered only record number based or linear search and are terribly slow for key based indexed search.
16
+
17
+
Sqlite stores data in [B+Tree pages](https://en.wikipedia.org/wiki/B%2B_tree) and so can locate data from millions of records using variable length keys without exerting stress on CPU or RAM. This is demonstrated using the sample databases provided in the example sections.
18
+
19
+
Even with the 500 odd kilbytes RAM available on ESP32, millions of records and gigabyte sized databases can be accessed.
20
+
11
21
## Usage
12
22
13
23
Sqlite3 C API such as `sqlite3_open` can be directly invoked. Before calling please invoke:
@@ -94,14 +104,23 @@ No dependencies except for the Arduino SDK. The Sqlite3 code is included with th
94
104
Any Flash memory such as those available on SPIFFS or Micro SD cards have limitation on number of writes / erase per sector. Usually the limitation is 10000 writes or 100000 writes (on the same sector). Although ESP32 supports wear-levelling, this is to be kept in mind before venturing into write-intensive database projects. There is no limitation on reading from Flash.
95
105
96
106
## Acknowledgements
107
+
97
108
* This library was developed based on NodeMCU module developed by [Luiz Felipe Silva](https://github.com/luizfeliperj). The documentation can be found [here](https://nodemcu.readthedocs.io/en/master/en/modules/sqlite3/).
98
109
* The census2000 and baby names databases were taken from here: http://2016.padjo.org/tutorials/sqlite-data-starterpacks/. But no license information is available.
99
110
* The mdr512.db (Million Domain Rank database) was created with data from [The Majestic Million](https://majestic.com/reports/majestic-million) and is provided under CC 3.0 Attribution license.
100
111
* The [ESP32 core for Arduino](https://github.com/espressif/arduino-esp32)
101
112
*[The Arduino platform](https://arduino.cc)
102
113
103
-
## Screenshot (output of Micro SD example)
114
+
## Screenshots
115
+
116
+
Output of Micro SD example:
117
+
104
118

105
119
120
+
Output of SD Card database query through WebServer example:
121
+
122
+

123
+

124
+
106
125
## Issues
107
126
Please contact the author (Arundale Ramanathan) at arun@siara.cc if you find any problem (or create issue here).
0 commit comments