{"id":46773872,"url":"https://github.com/ilkerkorkut/gorm-hazelcast","last_synced_at":"2026-03-09T23:41:29.224Z","repository":{"id":57521776,"uuid":"243787334","full_name":"ilkerkorkut/gorm-hazelcast","owner":"ilkerkorkut","description":"gorm Hazelcast Cache","archived":false,"fork":false,"pushed_at":"2020-03-09T12:20:08.000Z","size":26,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T15:51:29.327Z","etag":null,"topics":["cache","database","database-cache","distributed-cache","go","gorm","hazelcast","hazelcast-client"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilkerkorkut.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":"2020-02-28T14:58:29.000Z","updated_at":"2024-06-20T15:51:29.328Z","dependencies_parsed_at":"2022-09-26T18:10:35.327Z","dependency_job_id":null,"html_url":"https://github.com/ilkerkorkut/gorm-hazelcast","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ilkerkorkut/gorm-hazelcast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkerkorkut%2Fgorm-hazelcast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkerkorkut%2Fgorm-hazelcast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkerkorkut%2Fgorm-hazelcast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkerkorkut%2Fgorm-hazelcast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilkerkorkut","download_url":"https://codeload.github.com/ilkerkorkut/gorm-hazelcast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkerkorkut%2Fgorm-hazelcast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30316774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"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":["cache","database","database-cache","distributed-cache","go","gorm","hazelcast","hazelcast-client"],"created_at":"2026-03-09T23:41:28.523Z","updated_at":"2026-03-09T23:41:29.216Z","avatar_url":"https://github.com/ilkerkorkut.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"gorm-hazelcast\n=====================\n\nThe primary goal of the `hzgorm` project is to make it easier to cache [gorm](https://github.com/jinzhu/gorm) data results with a single line of code on Hazelcast. This module provides integration with [Hazelcast](http://github.com/hazelcast/hazelcast).\n\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/ilkerkorkut/gorm-hazelcast) ![GitHub last commit](https://img.shields.io/github/last-commit/ilkerkorkut/gorm-hazelcast) ![GitHub](https://img.shields.io/github/license/ilkerkorkut/gorm-hazelcast) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/ilkerkorkut/gorm-hazelcast)\n\n[Download Hazelcast](https://hazelcast.org/imdg/download/archives/#hazelcast-imdg-3-12-6)\n\n[Hazelcast Reference Manual](https://docs.hazelcast.org/docs/3.12.6/manual/html-single/index.html)\n\n\n# Requirements\nHazelcast IMDG 3.6 or newer _(currently not supported 4.0)_\n\n- Run hazelcast with docker:\n``` \ndocker run hazelcast/hazelcast:3.12.6\n```\n\n# Installation\n\n`go get github.com/ilkerkorkut/gorm-hazelcast`\n\n# Usage\n\nUse gorm-hazelcast plugin with a single-line cache registration on gorm. To initialize with Options parameters, please look at [Options section]((https://github.com/ilkerkorkut/gorm-hazelcast#options)).\n\nThere are different types of usages in [examples](https://github.com/ilkerkorkut/gorm-hazelcast/tree/master/examples) directory. Look at [Api section](https://github.com/ilkerkorkut/gorm-hazelcast#api) for additional programmatic usage.\n\n```go\nimport hzgorm \"github.com/ilkerkorkut/gorm-hazelcast\"\n\nhzgorm.Register(db, nil)\n```\n\n# Options\ngorm-hazelcast provides three type option parameters during initializing.\n\n`CacheAfterPersist` : If `CacheAfterPersist` option is `true` , caches data after its persistence to db otherwise persists cache before persisting data on db. By default `CacheAfterPersist` is `true`\n\n`Ttl`: You can set `Ttl (Time to Live)` parameter to your options for your whole queries. By default this option is infinite. Look at [Api section](https://github.com/ilkerkorkut/gorm-hazelcast#api) for query based ttl.\n\n`HazelcastClientConfig`: In Options `HazelcastClientConfig` field. You are able to set your custom [Hazelcast client configuration](https://github.com/hazelcast/hazelcast-go-client#142-configuring-hazelcast-go-client). \n\n```go\nhzgorm.Register(db, \u0026hzgorm.Options{\n    CacheAfterPersist: true,\n    Ttl: 120 * time.Second,\n})\n```\n\n# Api\nAfter registering `hzgorm` instance, you will be able to use following api methods.\n\n```go\nhz.EvictAll(tableName) // Evict all values in cache with its tablename\nhz.EvictWithPrimaryKey(tableName, primaryKey) // Evict single cache entry with tablename and primarykey\nhz.DisableCache(hzgorm.ReadWriteUpdate) // Disables cache with type, ReadWriteUpdate, Read, Write ,Update\nhz.EnableCache(hzgorm.ReadWriteUpdate) // Enables cache with type, ReadWriteUpdate, Read, Write ,Update\nhz.SetQueryTtl(120 * time.Second) // Single query based TTL\nhz.Client // Reach native hazelcast-go-client\nhz.Options // Change or get options dynamically (dynamic options changes are not recommended)\n```\n\n## Supported SQL Syntax for Hazelcast Cache \n  \n**AND/OR:** `\u003cexpression\u003e AND \u003cexpression\u003e AND \u003cexpression\u003e...`\n  \n- `active AND age \u003e 30  `\n- `active = false OR age = 45 OR name = 'Joe'`\n- `active AND ( age \u003e 20 OR salary \u003c 60000 )`\n- `Equality: =, !=, \u003c, ⇐, \u003e, \u003e=`\n  \n`\u003cexpression\u003e = value`\n\n`age \u003c= 30`\n\n`name = 'Joe'`\n\n`salary != 50000`\n\n**BETWEEN:** `\u003cattribute\u003e [NOT] BETWEEN \u003cvalue1\u003e AND \u003cvalue2\u003e`\n  \n- `age BETWEEN 20 AND 33 (same as age \u003e= 20 AND age ⇐ 33)`\n- `age NOT BETWEEN 30 AND 40 (same as age \u003c 30 OR age \u003e 40)`\n\n**IN:** `\u003cattribute\u003e [NOT] IN (val1, val2,...)`\n  \n- `age IN ( 20, 30, 40 )`\n- `age NOT IN ( 60, 70 )`\n- `active AND ( salary \u003e= 50000 OR ( age NOT BETWEEN 20 AND 30 ) )`\n- `age IN ( 20, 30, 40 ) AND salary BETWEEN ( 50000, 80000 )`\n\n**LIKE:** `\u003cattribute\u003e [NOT] LIKE 'expression'`\n  \nThe % (percentage sign) is the placeholder for multiple characters, an _ (underscore) is the placeholder for only one character.  \n  \n- `name LIKE 'Jo%' (true for 'Joe', 'Josh', 'Joseph' etc.)`\n- `name LIKE 'Jo_' (true for 'Joe'; false for 'Josh')`\n- `name NOT LIKE 'Jo_' (true for 'Josh'; false for 'Joe')`\n- `name LIKE 'J_s%' (true for 'Josh', 'Joseph'; false 'John', 'Joe')`\n\n**ILIKE:** `\u003cattribute\u003e [NOT] ILIKE 'expression'`\n  \nILIKE is similar to the LIKE predicate but in a case-insensitive manner.  \n  \n- `name ILIKE 'Jo%' (true for 'Joe', 'joe', 'jOe','Josh','joSH', etc.)`\n- `name ILIKE 'Jo_' (true for 'Joe' or 'jOE'; false for 'Josh')`\n\n**REGEX:** `\u003cattribute\u003e [NOT] REGEX 'expression'`\n\n- `name REGEX 'abc-.*' (true for 'abc-123'; false for 'abx-123')`\n\n\n**Supports Preloading entities and cache them as another map.** \n\n**Data orders are not guaranteed.**\n\n\n# Contributing\n\nFeel free to contribute, or [create an issue](https://github.com/ilkerkorkut/gorm-hazelcast/issues) if you found a bug or need a feature request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filkerkorkut%2Fgorm-hazelcast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filkerkorkut%2Fgorm-hazelcast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filkerkorkut%2Fgorm-hazelcast/lists"}