{"id":19181646,"url":"https://github.com/rvillemeur/glorpbook","last_synced_at":"2026-04-15T23:32:59.251Z","repository":{"id":172057055,"uuid":"141647217","full_name":"rvillemeur/glorpbook","owner":"rvillemeur","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-03T00:19:29.000Z","size":1235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T02:22:06.970Z","etag":null,"topics":["database","glorp","pharo","smalltalk"],"latest_commit_sha":null,"homepage":null,"language":"Smalltalk","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/rvillemeur.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":"2018-07-20T01:17:24.000Z","updated_at":"2022-04-15T12:39:44.000Z","dependencies_parsed_at":"2025-01-04T04:12:04.412Z","dependency_job_id":"13a74a34-2581-4b6c-8964-5b9a0cef6c47","html_url":"https://github.com/rvillemeur/glorpbook","commit_stats":null,"previous_names":["rvillemeur/glorpbook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rvillemeur/glorpbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvillemeur%2Fglorpbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvillemeur%2Fglorpbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvillemeur%2Fglorpbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvillemeur%2Fglorpbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvillemeur","download_url":"https://codeload.github.com/rvillemeur/glorpbook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvillemeur%2Fglorpbook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31865067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":["database","glorp","pharo","smalltalk"],"created_at":"2024-11-09T10:54:01.537Z","updated_at":"2026-04-15T23:32:59.230Z","avatar_url":"https://github.com/rvillemeur.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"Experiment based on : [Pharo smalltalk glorp book](https://files.pharo.org/books-pdfs/booklet-Glorp/2017-05-02-Glorp-Spiral.pdf)\n\n```smalltalk\nMetacello new\n\tbaseline: 'GlorpBook';\n\trepository: 'github://rvillemeur/glorpbook/repository';\n\tload\n```\n\n## short glop cheat sheet\n\nDomain model Class: #Person, stored in table PERSON in database.\n\n1. DescriptorSystem subclass\n\t1. DescriptorSystem subclass: #GlorpBookDescriptorSystem\n\t1. classModelForYourClass (ex: classModelForPerson)\n\tMessages use to list attributes of Model\n\t1. tableForYOURTABLE (ex: tableForPERSON)\n\tMessage describing fields in the table\n\t1. descriptorForYourClass (ex: descriptorForPerson)\n\tLink between attributes ofs classModelForXXX and fields of tableForXXX\n1. System, session et database accessor.\n\t1. Create login message to retreive the login\n\t1. Use the Login you've just created to retreive the accessor\n\t1. You can then retrive the session session using the message sessionForLogin, which will link login, accessor and session.\n\t\t\nOnce connected to the database, you have to run in pharo workspace \"session createTables\" to create the table in your new database\n\nRecord you work in your session, use the message  \u003e\u003e inUnitOfWorkDo: [ … ]\n\nSQL | Glorp\n------------ | -------------\nSelect * from TABLE | Session read: DomainClass\nSelect * from TABLE where attributes = 'value' | Session read: DomainClass where: [:each \u0026#124; each attribute = 'value']\nSelect * from TABLE where attributes like 'value%' | Session read: DomainClass where: [:each \u0026#124; each attribute similarTo: 'value']\nUpdate table TABLE\tSet attribute = 'value' Where condition = 'value2' | Instance := session readOneOf: DomainClass Where: [ :each \u0026#124; each condition = 'value2' ] Instance attribute: value.\nDelete from TABLE Where condition = 'value' | Instance := session readOneOf: DomainClass Where: [ :each \u0026#124; each condition = 'value2' ] Instance delete: value. Or (for multiple deletion) \tSession delete: DomainClass \tWhere: [ :each \u0026#124; each condition = 'value2' ]\nSelect * from TABLE where attributes = 'value' Order by | session read: DomainClass where: [:each \u0026#124; each attribute = 'value'];orderBy: [:each \u0026#124; each attribute = 'value']\nSelect * from TABLE where attributes = 'value' Group by | session read: DomainClass where: [:each \u0026#124; each attribute = 'value'];groupBy: [:each \u0026#124; each attribute = 'value']\n\t\n\nEach of your persisted objects should have an instance of GlorpClassModel in the descriptor system containing all the attributes of your class.\n\n## Defining relation between classes \n\nattribute | relation\n--------- | -----------\nnewAttributeNamed: #email | Used to define simple scalar/literal values \tsuch as Numbers, Strings, Dates, etc.\nnewAttributeNamed: #address type: Address | Used to define 1:1 (one to one) relations with other objects of your domain model.\nnewAttributeNamed: #invoices collectionOf: Invoice | Used to define 1:n (one to many) and n:m (many to many) relations of your class model with other models.\nnewAttributeNamed: #invoices collection: collectionClass of: Invoice | Similar as the one above for 1:n and n:m relations, but you can define what kind of Collection is going to be used.\nnewAttributeNamed: #counters dictionaryFrom: keyClass to: valueClass | Used to define an attribute that is a Dictionary where the key is key-Class and its values are instances of valueClass.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvillemeur%2Fglorpbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvillemeur%2Fglorpbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvillemeur%2Fglorpbook/lists"}