{"id":18777901,"url":"https://github.com/ststeiger/sqlite.fullymanaged","last_synced_at":"2026-05-02T01:34:56.454Z","repository":{"id":242858048,"uuid":"810759474","full_name":"ststeiger/SQLite.FullyManaged","owner":"ststeiger","description":"Fully Managed C# port of SQLite","archived":false,"fork":false,"pushed_at":"2025-05-28T16:19:53.000Z","size":1714,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-28T17:33:45.713Z","etag":null,"topics":["csharp","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ststeiger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-06-05T09:55:48.000Z","updated_at":"2025-05-28T16:19:57.000Z","dependencies_parsed_at":"2024-06-05T11:53:23.649Z","dependency_job_id":"e69a9856-710d-45e7-9736-5a768bc5b7c0","html_url":"https://github.com/ststeiger/SQLite.FullyManaged","commit_stats":null,"previous_names":["ststeiger/sqlite.fullymanaged"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ststeiger/SQLite.FullyManaged","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ststeiger%2FSQLite.FullyManaged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ststeiger%2FSQLite.FullyManaged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ststeiger%2FSQLite.FullyManaged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ststeiger%2FSQLite.FullyManaged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ststeiger","download_url":"https://codeload.github.com/ststeiger/SQLite.FullyManaged/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ststeiger%2FSQLite.FullyManaged/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32520156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"ssl_error","status_checked_at":"2026-05-02T01:12:54.261Z","response_time":64,"last_error":"SSL_read: 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","sqlite","sqlite3"],"created_at":"2024-11-07T20:14:16.025Z","updated_at":"2026-05-02T01:34:56.435Z","avatar_url":"https://github.com/ststeiger.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLite.FullyManaged\n\nA fully managed SQLite3 port to C# using NetStandard 2.0. \u003cbr /\u003e\nThis project contains unsafe code. \u003cbr /\u003e\nProbably not safe for production use. \u003cbr /\u003e\nLicense as with SQLite and Community.CsharpSqlite and 2008 Noah B Hart SQLite3 port to C#-SQLite. \u003cbr /\u003e\nNo warranty whatsovever. \n\n\n**Note:** \n\n    Data Source=file:///D:/username/Downloads/switzerland.mbtiles;Version=3;Read Only=True;\n\nNote that the data source needs to start with file:///. \u003cbr /\u003e\nBut then again, you can't just do \n\n    new System.Uri(\"your_filename_here\", System.UriKind.RelativeOrAbsolute).AbsoluteUri\n\nbecause it's not actually an Uri - instead it's just the filename prefixed by \"file:///\". \n\n\n## Usage:\n\nAdd the package reference: \n\n    dotnet add package SQLite.FullyManaged \n\nAnd then use the library:     \n\n\n    namespace TestFullyManaged\n    {\n    \n    \n        using Connection = SQLite.FullyManaged.SqliteConnection;\n        using ConnectionStringBuilder = SQLite.FullyManaged.SqliteConnectionStringBuilder;\n    \n    \n        internal class Program\n        {\n    \n    \n            public static async System.Threading.Tasks.Task\u003cint\u003e Main(string[] args)\n            {\n                System.IO.Stream stream = null;\n                int x = 132; int y = 164; int zoom = 8;\n                string cs = \"Data Source=D:\\\\username\\\\Downloads\\\\switzerland.mbtiles;Version=3; Read Only=True;\"; // this doesn't work \n                cs = \"Data Source=file:///D:/username/Downloads/witzerland.mbtiles;Version=3;Read Only=True;\"; // Note: no %20 for whitespace etc. - it's not an actual Uri\n    \n                ConnectionStringBuilder csb = new ConnectionStringBuilder();\n                // csb.ConnectionString = \"Data Source=D:\\\\username\\\\Downloads\\\\switzerland.mbtiles;Version=3; Read Only=True;\"; // BAD\n                // csb.Uri = \"file:///D:/username/Downloads/switzerland.mbtiles\";\n                csb.FileName = \"D:/username/Downloads/switzerland.mbtiles\";\n    \n                csb.Version = 3;\n                csb.ReadOnly = true;\n                cs = csb.ConnectionString;\n                System.Console.WriteLine(cs);\n    \n    \n                using (System.Data.Common.DbConnection conn = new Connection(cs))\n                {\n                    if (conn.State != System.Data.ConnectionState.Open)\n                        conn.Open();\n    \n                    using (System.Data.Common.DbCommand cmd = conn.CreateCommand())\n                    {\n                        cmd.CommandText = string.Format(\"SELECT * FROM tiles WHERE tile_column = {0} and tile_row = {1} and zoom_level = {2}\", x, y, zoom);\n    \n                        using (System.Data.Common.DbDataReader reader = cmd.ExecuteReader())\n                        {\n                            int ord = reader.GetOrdinal(\"tile_data\");\n    \n                            if (reader.Read())\n                            {\n                                stream = reader.GetStream(ord);\n                            } // End if (reader.Read()) \n    \n                        } // End Using reader \n    \n                        if (conn.State != System.Data.ConnectionState.Open)\n                            conn.Close();\n                    } // End Using cmd \n    \n                } // End Using conn \n    \n                if (stream != null)\n                {\n                    byte[] buffer = StreamToByteArray(stream)!;\n                    string base64 = System.Convert.ToBase64String(buffer);\n                    System.Console.WriteLine(\"base64: \" + base64);\n                } // End if (stream != null) \n    \n                System.Console.WriteLine(\" --- Press any key to continue --- \");\n                return await System.Threading.Tasks.Task.FromResult(0);\n            } // End Task Main \n\n            \n            public static byte[]? StreamToByteArray(System.IO.Stream stream)\n            {\n                byte[]? retData = null;\n    \n                if (stream != null)\n                {\n                    // Assuming the stream size is relatively small\n                    int bufferSize = 4096; // Adjust buffer size as needed\n                    byte[] buffer = new byte[bufferSize];\n                    using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream())\n                    {\n                        int bytesRead;\n                        while ((bytesRead = stream.Read(buffer, 0, bufferSize)) \u003e 0)\n                        {\n                            memoryStream.Write(buffer, 0, bytesRead);\n                        } // Whend \n    \n                        retData = memoryStream.ToArray();\n                    } // End Using memoryStream \n    \n                } // End if (stream != null) \n    \n                return retData;\n            } // End Function StreamToByteArray \n\n    \n        } // End Class Program \n    \n    \n    } // End Namespace \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fststeiger%2Fsqlite.fullymanaged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fststeiger%2Fsqlite.fullymanaged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fststeiger%2Fsqlite.fullymanaged/lists"}