{"id":16887578,"url":"https://github.com/alicebob/bakelite","last_synced_at":"2025-06-29T13:32:59.057Z","repository":{"id":39619673,"uuid":"494706962","full_name":"alicebob/bakelite","owner":"alicebob","description":"Pure Go SQLite file exporter","archived":false,"fork":false,"pushed_at":"2022-05-31T18:09:02.000Z","size":82,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T02:39:36.484Z","etag":null,"topics":["exporter","go","golang","sqlite","sqlite3","streaming"],"latest_commit_sha":null,"homepage":"","language":"Go","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/alicebob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-21T07:02:59.000Z","updated_at":"2025-04-19T19:43:44.000Z","dependencies_parsed_at":"2022-09-19T16:02:15.046Z","dependency_job_id":null,"html_url":"https://github.com/alicebob/bakelite","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alicebob/bakelite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicebob%2Fbakelite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicebob%2Fbakelite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicebob%2Fbakelite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicebob%2Fbakelite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alicebob","download_url":"https://codeload.github.com/alicebob/bakelite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alicebob%2Fbakelite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262600654,"owners_count":23335109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["exporter","go","golang","sqlite","sqlite3","streaming"],"created_at":"2024-10-13T16:45:07.309Z","updated_at":"2025-06-29T13:32:59.028Z","avatar_url":"https://github.com/alicebob.png","language":"Go","readme":"# bakelite\n\nPure Go SQLite file exporter\n\nThis library writes SQLite files from scratch. You hand it the data you want in\nthe tables, and you get back your .SQLite file.  \n\nNo dependencies. No C. No SQL.\n\n\n# use case\n\nAt [work](https://www.engagespark.com), we have customers who have campaigns\nwith millions of SMSs and IVRs. The details can be downloaded as an\n[.XLSX](https://github.com/alicebob/streamxlsx) file, but dealing with 500Mb\nfiles in Excel is no fun. Bakelite gives a light way to generate a .sqlite\nfile.\n\n\n# example\n\n```\n    // New() keeps the whole database in memory. See NewTmp() for a disk based option.\n    db := bakelite.New()\n    defer db.Close()\n\n    // Table with all data from a slice\n    err := db.AddSlice(\"planets\", []string{\"name\", \"moons\"}, [][]any{\n        {\"Mercury\", 0},\n        {\"Venus\", 0},\n        {\"Earth\", 1},\n        {\"Mars\", 2},\n        {\"Jupiter\", 80},\n        {\"Saturn\", 83},\n        {\"Uranus\", 27},\n        {\"Neptune\", 4},\n    })\n\n    // Table with all data from a channel\n    stars := make(chan []any, 10)\n    stars \u003c- []any{\"Alpha Centauri\", \"4\"}\n    stars \u003c- []any{\"Barnard's Star\", \"6\"}\n    stars \u003c- []any{\"Luhman 16\", \"6\"}\n    stars \u003c- []any{\"WISE 0855−0714\", \"7\"}\n    stars \u003c- []any{\"Wolf 359\", \"7\"}\n    err := db.AddChan(\"stars\", []string{\"name\", \"lightyears\"}, stars)\n\n    b := \u0026bytes.Buffer{}\n    err := db.WriteTo(b)\n```\n\n\n# status\n\nNot used in production yet. It can write files and SQLite is happy with those\nfiles.\n\nMain todos:\n  - support more Go datatypes, such as int32 and bool.\n  - hasn't seen a profiler.\n\nWhat this library won't do:\n  - add indexes. (but every row gets an internal \"row id\", which we could\n    expose as \"integer primary key\" data type, since sqlite uses the rowid for\n    those)\n  - concurrency. This library generates the file, which you can then save and\n    use concurrently, as any normal sqlite database file. But while the file is\n    being generated, it can't be used.\n  - updates. This is a write-once affair.\n\n\n## links\n\nhttps://sqlite.org/fileformat2.html  \nhttps://litecli.com/  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falicebob%2Fbakelite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falicebob%2Fbakelite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falicebob%2Fbakelite/lists"}