{"id":13771023,"url":"https://github.com/mumez/PunQLite","last_synced_at":"2025-05-11T03:33:01.666Z","repository":{"id":12703230,"uuid":"15375690","full_name":"mumez/PunQLite","owner":"mumez","description":"UnQLite binding for Pharo Smalltalk","archived":false,"fork":false,"pushed_at":"2024-02-16T13:06:08.000Z","size":647,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T15:39:37.311Z","etag":null,"topics":["pharo","pharo-smalltalk","smalltalk","unqlite"],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","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/mumez.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}},"created_at":"2013-12-22T13:12:53.000Z","updated_at":"2022-08-14T17:42:38.000Z","dependencies_parsed_at":"2024-08-03T17:04:13.455Z","dependency_job_id":"717305a1-106c-4055-9548-2c8c923133dd","html_url":"https://github.com/mumez/PunQLite","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FPunQLite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FPunQLite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FPunQLite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FPunQLite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mumez","download_url":"https://codeload.github.com/mumez/PunQLite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"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":["pharo","pharo-smalltalk","smalltalk","unqlite"],"created_at":"2024-08-03T17:00:46.606Z","updated_at":"2025-05-11T03:33:00.382Z","avatar_url":"https://github.com/mumez.png","language":"Smalltalk","funding_links":[],"categories":["Databases"],"sub_categories":[],"readme":"PunQLite [![Build Status](https://travis-ci.org/estebanlm/PunQLite.png)](https://travis-ci.org/estebanlm/PunQLite)\n========\n\n[UnQLite](http://unqlite.org \"UnQLite\") binding for [Pharo Smalltalk](http://www.pharo-project.org/ \"Pharo\").\nUnQLite is a fast, lightweight, portable, embedded KVS with a simple scripting engine (Jx9). By using PunQLite, you can store/load lots of data as if just using a normal Dictionary.\n\n[![Release](https://img.shields.io/github/v/tag/mumez/PunQLite?label=release)](https://github.com/mumez/PunQLite/releases)\n![Tests](https://img.shields.io/badge/tests-29-green)\n[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE.txt)\n\n[![Social](https://img.shields.io/github/stars/mumez/PunQLite?style=social)]()\n[![Forks](https://img.shields.io/github/forks/mumez/PunQLite?style=sociall)]()\n\nDirectories:\n\n- repository\n + [Cypress](https://github.com/CampSmalltalk/Cypress) style Smalltalk source tree\n\nFor MCZ packages, visit \u003ca href=\"http://smalltalkhub.com/#!/~MasashiUmezawa/PunQLite\"\u003eSmalltalkHub PunQLite site\u003c/a\u003e.\n\n## Installation ##\n- Compile UnQLite\n\nIt would be very easy. UnQLite consists of only two files.\n\n```Shell\ngcc -m32 -c unqlite.c\n\n#linux\ngcc -m32 -shared -o unqlite.so unqlite.o\n\n#win (MinGW)\ngcc -m32 -shared -static-libgcc -o unqlite.dll unqlite.o -Wl,--add-stdcall-alias\n\n#mac\ngcc -m32 -dynamiclib -o unqlite.dylib unqlite.o\n```\n\n- Load PunQLite\n\n```Smalltalk\nMetacello new \n\trepository: 'github://mumez/PunQLite/repository';\n\tbaseline: 'PunQLite';\n\tload.\n```\n\n## Performance ##\n```Smalltalk\n\"Simple store/load round-trip\"\nTime millisecondsToRun:[\ndb := PqDatabase open: 'bench.db'.\nval := '0'.\n1 to: 100000 do: [:idx | | key | \n\tkey := idx asString.\n\tdb at: key put: val.\n\tval := (db at: key) asString.\n].\ndb close.\n]. \"===\u003e 877 msecs\"\n```\nI felt it is quite fast. 100000 round-trips in 877 msecs. Please try the code by yourself.\n\n## Usages ##\n```Smalltalk\n\"Like a Dictionary\"\ndb := PqDatabase openOnMemory.\ndb at: 'Smalltalk' put: 'COOL'.\ndb at: 'Pharo' put: 'HOT'.\ndb at: 'Smalltalk' ifPresent: [:data |\n\tdata asString inspect\n].\nTranscript cr; show: db keys.\ndb do: [:cursor |\n\tTranscript cr; show: cursor currentStringKey; space; show: cursor currentStringValue.\t\t\n].\ndb close.\n\n```\n```Smalltalk\n\"Using explicit transaction\"\ndb := PqDatabase open: 'trans.db'.\ndb disableAutoCommit.\n1 to: 100 do: [:idx | | key | \n\tkey := idx asString.\n\tdb transact: [db at: key put: ('value-', key)]\n].\ndb close.\n```\n```Smalltalk\n\"Using cursor seek\"\ndb := PqDatabase openOnMemory.\n1 to: 10 do: [:idx |\n\tdb at: idx asString put: 'value-', idx asString.\n].\ncursor := db newCursor.\nentries := OrderedCollection new.\ncursor seek: '5' untilEndDo: [:cur |\n\tentries add: (cur currentStringKey -\u003e cur currentStringValue)\t\n].\ncursor close.\ndb close.\n^entries \"==\u003e an OrderedCollection('5'-\u003e'value-5' '6'-\u003e'value-6' '7'-\u003e'value-7' '8'-\u003e'value-8' '9'-\u003e'value-9' '10'-\u003e'value-10')\"\n```\n```Smalltalk\n\"Import from files\"\ndb := PqDatabase open: 'mczCache.db'.\n(FileSystem workingDirectory / 'package-cache') files do: [:each | \n\t(db importAt: each basename fromFile: each pathString)\n\t\t ifTrue: [db commitTransaction].\n].\ndb keys inspect.\ndb close.\n```\n```Smalltalk\n\"Excute Jx9 scripting language\"\ndb := PqDatabase openOnMemory.\nsrc := '\n\t$var = 123;\n\t$str = \"$var - one, two, three!\";\n\t$tm = time();\n\t'.\nexecuter := db jx9.\nexecuter evaluate: src.\n(executer extract: 'var') asInt inspect.\n(executer extract: 'str') asString inspect. \n(executer extract: 'tm') asInt inspect.\nexecuter release.\ndb close.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumez%2FPunQLite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmumez%2FPunQLite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumez%2FPunQLite/lists"}