Skip to content

Commit

Permalink
converted
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Sep 8, 2022
1 parent 41530b4 commit 0da1ff9
Show file tree
Hide file tree
Showing 18 changed files with 203 additions and 1,589 deletions.
12 changes: 12 additions & 0 deletions Chapters/1-Started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Getting StartedTo install ReStore in your image follow the instructions on the GitHub project page for your Smalltalk dialect:- Dolphin Smalltalk - [https://github.com/rko281/ReStore](https://github.com/rko281/ReStore)- Pharo - [https://github.com/rko281/ReStoreForPharo](https://github.com/rko281/ReStoreForPharo)The class `SSWReStore` represents a ReStore session/connection; following installation a default singleton instance of `SSWReStore` is created and assigned to the global variable `ReStore`. We will use this global default throughout most of this document \(see chapter 8 for information on working with multiple ReStore instances\). ### Choosing a DatabaseReStore supports several different databases via the SSWSQLDialect class hierarchy. Currently defined SQL Dialects are:- SQLite- MySQL / MariaDB- PostgreSQL- SQL Server- AccessEach subclass defines the different behavior, data types, functions etc. supported by a particular database. ReStore automatically selects the appropriate subclass after connecting to your chosen database; this ensures your application code is independent of database choice, enabling you to switch databases easily if required. For example, for simplicity and speed you may use SQLite during development, then deploy to PostgreSQL for better scalability.### Configuring ReStoreAfter choosing and installing your database you must tell ReStore how to connect to it; the method for doing this varies by Smalltalk dialect:#### Dolphin SmalltalkReStore for Dolphin accesses databases via ODBC. You must first create a Data Source Name \(DSN\) using the driver for your chosen database via the ODBC control panel. Since Dolphin is a 32-bit application ensure that you use the 32-bit ODBC control panel – you can open this from your Dolphin image by evaluating ```ReStore openODBC```Once the DSN is created you can configure ReStore to use it as follows:```ReStore dsn: ‘MyDataSourceName’```#### PharoPharo currently supports SQLite, MySQL and PostgreSQL. You must create the appropriate connection object then assign this to ReStore as follows:```"SQLite – see https://github.com/pharo-rdbms/Pharo-SQLite3 for more information"
ReStore connection: (SSWSQLite3Connection on: (Smalltalk imageDirectory / 'test.db') fullName)``````"PostgreSQL – see https://github.com/svenvc/P3 for more information"
ReStore connection: (SSWP3Connection new url: 'psql://user:pwd@192.168.1.234:5432/database')``````"MySQL – see https://github.com/pharo-rdbms/Pharo-MySQL for more information"
ReStore connection:
(SSWMySQLConnection new
connectionSpec:
(MySQLDriverSpec new
db: 'database'; host: '192.168.1.234'; port: 3306;
user: 'user'; password: 'pwd';
yourself);
yourself)```### Connecting and DisconnectingOnce you have configured ReStore for your chosen database you may connect to and disconnect from the database as follows:```ReStore connect.
ReStore disconnect.```
Expand Down
70 changes: 0 additions & 70 deletions Chapters/1-Started.pillar

This file was deleted.

Loading

0 comments on commit 0da1ff9

Please sign in to comment.