{"repo":"rko281/ReStoreForPharo","free":true,"listed":false,"github":"https://github.com/rko281/ReStoreForPharo","clone":"git clone https://github.com/rko281/ReStoreForPharo.git","description":"Relational database persistence for Pharo objects","language":"Smalltalk","stars":35,"topics":["pharo","mysql","pharo-smalltalk","postgresql","relational-databases","smalltalk","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"What is ReStore? ReStore is a framework enabling Pharo objects to be stored in and read from relational databases (SQLite, PostgreSQL etc.). ReStore aims to make relational persistency as simple as possible, creating and maintaining the database structure itself and providing access to stored objects via familiar Smalltalk messages. Getting Started :warning: If you are using Pharo 11 or earlier please use the pharo11 branch. To load ReStore into your Pharo 12 image, evaluate: This will load ReStore with support for SQLite and MySQL (via pharo-rdbms), PostgreSQL (via P3), plus the example classes we'll discuss next. A Simple Example Let's consider a simple customer order application with the following classes (found in the SSW ReStore Examples package): The first step in adding persistency with ReStore is to define the structure of the classes. This is done with the class method reStoreDefinition - for the Customer class this is: A couple of things worth highlighting here: - define: #address as: Address dependent - adding dependent to a definition means that object is dependent on the originating object for its existence. In this case the customer's address object is dependent on the owning customer - this means any changes to the address will be saved along with the customer, and the address will be deleted if the customer is deleted. - define: #orders as: (OrderedCollection of: CustomerOrder dependent owner: #customer) - this is an example of an owned collection definition. ","default_branch":null,"files":null,"tree":[],"storefront":"/r/rko281","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rko281/ReStoreForPharo/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}