{"id":21112847,"url":"https://github.com/teddy55codes/sqlitedbaccess","last_synced_at":"2026-05-08T11:34:27.366Z","repository":{"id":65259906,"uuid":"589069494","full_name":"Teddy55Codes/SQLiteDBAccess","owner":"Teddy55Codes","description":"A lightweight sqlite nuget package. ","archived":false,"fork":false,"pushed_at":"2023-01-27T07:51:46.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-12T17:29:13.281Z","etag":null,"topics":["csharp","nuget","sql","sqlite"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/SQLiteDBAccess/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Teddy55Codes.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}},"created_at":"2023-01-15T00:14:00.000Z","updated_at":"2024-06-10T00:39:29.000Z","dependencies_parsed_at":"2023-02-15T06:45:51.981Z","dependency_job_id":null,"html_url":"https://github.com/Teddy55Codes/SQLiteDBAccess","commit_stats":null,"previous_names":["teddy55code/sqlitedbaccess"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Teddy55Codes/SQLiteDBAccess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FSQLiteDBAccess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FSQLiteDBAccess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FSQLiteDBAccess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FSQLiteDBAccess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Teddy55Codes","download_url":"https://codeload.github.com/Teddy55Codes/SQLiteDBAccess/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FSQLiteDBAccess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32778714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"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":["csharp","nuget","sql","sqlite"],"created_at":"2024-11-20T01:34:11.148Z","updated_at":"2026-05-08T11:34:27.330Z","avatar_url":"https://github.com/Teddy55Codes.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLiteDBAccess\n\nThis is a lightweight sqlite access library.\nIt allows you to easily create and access multiple different sqlite db files.\n\nsimply add/create a database via `SQLiteDBAccess.Instance()` This will check if there already is an instance for that file and ether create the file and return a new instance or get the already existing instance. \n\nYou can also pass a bool as 3rd attribute (default `true`) it determines if the file should be managed automatically or manually. \nIf set to `true` the file will be opened and closed on every call. \nIf that is to expensive for you you can pass `false` and open/close the file manually via `OpenDBFile()` and `CloseDBFile()`.\n\n### **Attention**\n**If a method in SQLiteDBAccess is used that returns an SQLDataReader the connection will not be closed even if file management is enabled. \nMeaning you will have to manually free the file with `CloseDBFile(yourReader)`. \n`yourReader` being the SQLiteDataReader that you have used.\nThis is necessary because the connection needs to be active to use the reader.**\n\nYou can also run any sqlite command via `CustomCommand` or `CustomCommandWithReturn` if you want to return value(s).\n\n## examples:\n\n### Create/Add Database\n```csharp\nvar dbAccess = SQLiteDBAccess.SQLiteDBAccess.Instance(\"mydb\", \"/home/teddy\"); // on windows path would be \"C:/Users/teddy\"\n```\n\nNote: \nDepending on if your file system is case sensitive creating a Database with the name `mydb` and `Mydb` will ether be the same (on non-case sensitive) or different (on case sensitive) instances and files.\n\n### Create Table\n````csharp\ndbAccess.CreateTable(\"MyTable\", \"Id INTEGER PRIMARY KEY, MyText TEXT, MyNumber INTEGER\");\n````\n\n### Insert Into Table\n````csharp\nvar myNewText = \"'hello world'\";\nvar myNewNumber = 1337;\ndbAccess.Insert(\"MyTable\", \"MyText, MyNumber\", $\"{myNewText}, {myNewNumber}\");\n````\n\nNote:\nYou will need to add '' around items which contain spaces e.g. `'hello world'`.\n### Read Single Row From Table By Attribute\n````csharp\nvar reader = dbAccess.GetByAttribute(\"MyTable\", \"Id\", \"1\");\nif (reader.Read())\n{\n    Console.WriteLine($\"{reader.GetName(0)}: {reader.GetInt64(0)}\\n{reader.GetName(1)}: {reader.GetString(1)}\\n{reader.GetName(2)}: {reader.GetInt64(2)}\");\n} \ndbAccess.CloseDBFile(reader);\n````\n\nNote: \nGetByAttribute() can return multiple rows. In this example a primary key is used and result.Read() is only executed once. \nAny one of those factors will result in a single row being returned. \n\n### Read All Rows From Table\n````csharp\nvar reader = dbAccess.GetAll(\"MyTable\");\nwhile (reader.Read())\n{\n    Console.WriteLine($\"{reader.GetName(0)}: {reader.GetInt64(0)}\\n{reader.GetName(1)}: {reader.GetString(1)}\\n{reader.GetName(2)}: {reader.GetInt64(2)}\");\n} \ndbAccess.CloseDBFile(reader);\n````\n\nNote:\n- This Nuget Package is geared more towards smaller projects and will result in a multitude of issues if used in a bigger project. \n- This Nuget Package should not and was not created to be used with unsanitized user input.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy55codes%2Fsqlitedbaccess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteddy55codes%2Fsqlitedbaccess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy55codes%2Fsqlitedbaccess/lists"}