├── .gitattributes ├── .gitignore ├── README.md └── sqlite3.lua /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SQLite3 for Lua 2 | An SQLite3 Library for Lua 3 | 4 | ## Installation and Setup 5 | - Download **sqlite3.lua**. 6 | 7 | - Copy the **sqlite3.lua** file to your project. 8 | 9 | - Edit the **sqlite3.lua** file and set the *SQLite3Path* variable in the **tSettings** table to the directory where the Sqlite3 plugin can write the library file. 10 | 11 | *Note*: the application **must** have write access to the path. The user data folder is usually a good place for the Sqlite3 plugin to write the library file. 12 | 13 | There are various ways to do this depending on what system is being used. For example, if you're using [LÖVE](https://love2d.org/), you can simply type **love.filesystem.getSaveDirectory()**. 14 | 15 | - Require the scipt file. 16 | ```lua 17 | require('pathtoyourscripts.sqlite3'); 18 | ``` 19 | ## Usage Example 20 | ```lua 21 | --create/open database 22 | local hDB = sqlite3.open("mydatabase.db"); 23 | 24 | if hDB then 25 | local sQuery = "CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, name CHAR(20));"; 26 | hDB:execute(sQuery); 27 | 28 | hDB:close(); 29 | end 30 | ``` 31 | ## Documentation 32 | https://www.sqlite.org/ 33 | 34 | ## Additional Contributors 35 | DLLs provided by josefnpat 36 | 37 | https://love2d.org/forums/viewtopic.php?f=5&t=38486&hilit=sqlite3 38 | 39 | 40 | All base64 code by Ernest R. Ewert 41 | 42 | https://github.com/ErnieE5/ee5_base64 43 | 44 | ## License 45 | The MIT License (MIT) 46 | 47 | Copyright (c) 2016 Centauri Soldier 48 | 49 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 50 | 51 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 52 | 53 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 54 | --------------------------------------------------------------------------------