{"id":28766941,"url":"https://github.com/base/goleveldb","last_synced_at":"2026-02-27T10:09:31.143Z","repository":{"id":290528239,"uuid":"944262469","full_name":"base/goleveldb","owner":"base","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-28T17:14:46.000Z","size":1868,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-17T12:46:41.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/base.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-07T03:45:54.000Z","updated_at":"2025-04-28T16:49:37.000Z","dependencies_parsed_at":"2025-04-29T09:47:07.262Z","dependency_job_id":"c9ceec32-1ecf-4eed-a374-c3710f88504e","html_url":"https://github.com/base/goleveldb","commit_stats":null,"previous_names":["base/goleveldb"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/base/goleveldb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fgoleveldb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fgoleveldb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fgoleveldb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fgoleveldb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/base","download_url":"https://codeload.github.com/base/goleveldb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Fgoleveldb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899579,"owners_count":24664720,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-06-17T12:37:42.127Z","updated_at":"2026-02-27T10:09:26.094Z","avatar_url":"https://github.com/base.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fork Notice\n-----------\nForked from [github.com/syndtr/goleveldb](https://github.com/syndtr/goleveldb) on 2025-03-10 at commit 2ae1ddf74ef7020251ff1ff0fe8daac21a157761.\n\nThis corresponds to the version specified as a dependency by go-ethereum and op-geth when this fork was created (github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7).\n\n\nThis fork adds support for setting database initialization parameters via environment variables.\n\nSupported environment variables:\n\n| Name                                          | Type    | Default Value   | Corresponds To                              |\n| --------------------------------------------- | ------- | --------------- | ------------------------------------------- |\n| `LDB_BLOCK_SIZE`                              | Integer | `4096`          | `opt.Options.BlockSize`                         |\n| `LDB_COMPACTION_TABLE_SIZE`                   | Integer | `2097152`       | `opt.Options.CompactionTableSize`               |\n| `LDB_COMPACTION_TOTAL_SIZE`                   | Integer | `10485760`      | `opt.Options.CompactionTotalSize`               |\n| `LDB_COMPACTION_TOTAL_SIZE_MULTIPLIER`        | Integer | `10`            | `opt.Options.CompactionTotalSizeMultiplier`     |\n| `LDB_BLOCK_CACHE_CAPACITY`                    | Integer | `8388608`       | `opt.Options.BlockCacheCapacity`                |\n| `LDB_BLOCK_RESTART_INTERVAL`                  | Integer | `16`            | `opt.Options.BlockRestartInterval`              |\n| `LDB_COMPACTION_EXPAND_LIMIT_FACTOR`          | Integer | `25`            | `opt.Options.CompactionExpandLimitFactor`       |\n| `LDB_COMPACTION_GP_OVERLAPS_FACTOR`           | Integer | `10`            | `opt.Options.CompactionGPOverlapsFactor`        |\n| `LDB_COMPACTION_L0_TRIGGER`                   | Integer | `4`             | `opt.Options.CompactionL0Trigger`               |\n| `LDB_COMPACTION_SOURCE_LIMIT_FACTOR`          | Integer | `1`             | `opt.Options.CompactionSourceLimitFactor`       |\n| `LDB_ITERATOR_SAMPLING_RATE`                  | Integer | `1048576`       | `opt.Options.IteratorSamplingRate`              |\n| `LDB_WRITE_BUFFER`                            | Integer | `4194304`       | `opt.Options.WriteBuffer`                       |\n| `LDB_WRITE_L0_PAUSE_TRIGGER`                  | Integer | `12`            | `opt.Options.WriteL0PauseTrigger`               |\n| `LDB_WRITE_L0_SLOWDOWN_TRIGGER`               | Integer | `8`             | `opt.Options.WriteL0SlowdownTrigger`            |\n| `LDB_FILTER_BASE_LG`                          | Integer | `11`            | `opt.Options.FilterBaseLg`                      |\n| `LDB_OPEN_FILES_CACHE_CAPACITY`               | Integer | `200` (MacOS), `500` (others) | `opt.Options.OpenFilesCacheCapacity` |\n| `LDB_DISABLE_COMPRESSION`                     | Boolean | `false`         | `opt.Options.Compression` (if true, set to `opt.NoCompression`) |\n| `LDB_NO_SYNC`                                 | Boolean | `false`         | `opt.Options.NoSync`                            |\n| `LDB_BLOCK_CACHE_EVICT_REMOVED`               | Boolean | `false`         | `opt.Options.BlockCacheEvictRemoved`            |\n| `LDB_DISABLE_BUFFER_POOL`                     | Boolean | `false`         | `opt.Options.DisableBufferPool`                 |\n| `LDB_DISABLE_BLOCK_CACHE`                     | Boolean | `false`         | `opt.Options.DisableBlockCache`                 |\n| `LDB_DISABLE_COMPACTION_BACKOFF`              | Boolean | `false`         | `opt.Options.DisableCompactionBackoff`          |\n| `LDB_DISABLE_LARGE_BATCH_TRANSACTION`         | Boolean | `false`         | `opt.Options.DisableLargeBatchTransaction`      |\n| `LDB_DISABLE_SEEKS_COMPACTION`                | Boolean | `false`         | `opt.Options.DisableSeeksCompaction`            |\n| `LDB_ERROR_IF_EXIST`                          | Boolean | `false`         | `opt.Options.ErrorIfExist`                      |\n| `LDB_ERROR_IF_MISSING`                        | Boolean | `false`         | `opt.Options.ErrorIfMissing`                    |\n| `LDB_NO_WRITE_MERGE`                          | Boolean | `false`         | `opt.Options.NoWriteMerge`                      |\n| `LDB_READ_ONLY`                               | Boolean | `false`         | `opt.Options.ReadOnly`                          |\n| `LDB_DEBUG_OPTIONS`                           | Boolean | `false`         | will print `opt.Options` to the console after initialization |\n\n\n-----------\n\nThis is an implementation of the [LevelDB key/value database](http:code.google.com/p/leveldb) in the [Go programming language](http:golang.org).\n\n\nInstallation\n-----------\n\n\tgo get github.com/base/goleveldb/leveldb\n\nRequirements\n-----------\n\n* Need at least `go1.5` or newer.\n\nUsage\n-----------\n\nCreate or open a database:\n```go\n// The returned DB instance is safe for concurrent use. Which mean that all\n// DB's methods may be called concurrently from multiple goroutine.\ndb, err := leveldb.OpenFile(\"path/to/db\", nil)\n...\ndefer db.Close()\n...\n```\nRead or modify the database content:\n```go\n// Remember that the contents of the returned slice should not be modified.\ndata, err := db.Get([]byte(\"key\"), nil)\n...\nerr = db.Put([]byte(\"key\"), []byte(\"value\"), nil)\n...\nerr = db.Delete([]byte(\"key\"), nil)\n...\n```\n\nIterate over database content:\n```go\niter := db.NewIterator(nil, nil)\nfor iter.Next() {\n\t// Remember that the contents of the returned slice should not be modified, and\n\t// only valid until the next call to Next.\n\tkey := iter.Key()\n\tvalue := iter.Value()\n\t...\n}\niter.Release()\nerr = iter.Error()\n...\n```\nSeek-then-Iterate:\n```go\niter := db.NewIterator(nil, nil)\nfor ok := iter.Seek(key); ok; ok = iter.Next() {\n\t// Use key/value.\n\t...\n}\niter.Release()\nerr = iter.Error()\n...\n```\nIterate over subset of database content:\n```go\niter := db.NewIterator(\u0026util.Range{Start: []byte(\"foo\"), Limit: []byte(\"xoo\")}, nil)\nfor iter.Next() {\n\t// Use key/value.\n\t...\n}\niter.Release()\nerr = iter.Error()\n...\n```\nIterate over subset of database content with a particular prefix:\n```go\niter := db.NewIterator(util.BytesPrefix([]byte(\"foo-\")), nil)\nfor iter.Next() {\n\t// Use key/value.\n\t...\n}\niter.Release()\nerr = iter.Error()\n...\n```\nBatch writes:\n```go\nbatch := new(leveldb.Batch)\nbatch.Put([]byte(\"foo\"), []byte(\"value\"))\nbatch.Put([]byte(\"bar\"), []byte(\"another value\"))\nbatch.Delete([]byte(\"baz\"))\nerr = db.Write(batch, nil)\n...\n```\nUse bloom filter:\n```go\no := \u0026opt.Options{\n\tFilter: filter.NewBloomFilter(10),\n}\ndb, err := leveldb.OpenFile(\"path/to/db\", o)\n...\ndefer db.Close()\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Fgoleveldb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbase%2Fgoleveldb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Fgoleveldb/lists"}