-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
93 support for SQLite #141
Changes from 38 commits
1431f33
7183396
7867dd3
5a27326
851b5d0
f391cab
7eaa6a8
1377b0d
06f8dc6
b5a3dce
6909709
74e3186
ef28a4a
72706ee
5ac8404
d1c2515
2441876
c21dd99
cc6e2b6
3b678b2
7b2e417
2e4b985
c12c5db
34d9b01
c1665b4
270fd5d
8b79ca3
a203cc5
1ab67e9
7d842cb
cb7bbbf
c6a54ba
f138928
9ed4ee9
90aa096
0f75590
3c9eeeb
8dfa0f8
8523bcf
06d1585
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
![Mapless](./header.png) | ||
![Mapless](./hero.jpg) | ||
|
||
# Mapless | ||
|
||
Schema-less persistence for Smalltalk with support for multiple backends. | ||
|
||
[![Release](https://img.shields.io/github/v/tag/sebastianconcept/Mapless?label=release)](https://github.com/sebastianconcept/Mapless/releases) | ||
[![Unit Tests](https://github.com/sebastianconcept/Mapless/actions/workflows/build.yml/badge.svg)](https://github.com/sebastianconcept/Mapless/actions/workflows/build.yml) | ||
|
||
![Tests](https://img.shields.io/badge/tests-193-green) | ||
[![Coverage Status](https://codecov.io/github/sebastianconcept/Mapless/coverage.svg?branch=main)](https://codecov.io/gh/sebastianconcept/Mapless/branch/master) | ||
|
||
[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE.txt) | ||
[![Release](https://img.shields.io/github/v/tag/sebastianconcept/Mapless?label=release)](https://github.com/sebastianconcept/Mapless/releases) | ||
|
||
|
||
[![Pharo 7](https://img.shields.io/badge/Pharo-7-%23383932.svg)](https://pharo.org/download) | ||
[![Pharo 10](https://img.shields.io/badge/Pharo-10-%23383932.svg)](https://pharo.org/download) | ||
[![Pharo 11](https://img.shields.io/badge/Pharo-11-%23383932.svg)](https://pharo.org/download) | ||
|
||
[![Social](https://img.shields.io/github/stars/sebastianconcept/Mapless?style=social)]() | ||
[![Forks](https://img.shields.io/github/forks/sebastianconcept/Mapless?style=sociall)]() | ||
[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE.txt) | ||
|
||
### [Mapless GitHub Page](https://sebastianconcept.github.io/Mapless/) | ||
--- | ||
|
||
## Description | ||
|
||
Mapless is a schema-less persistence framework supporting multiple backends and offering a user-friendly API. For instance, querying Mapless objects involves a common family of methods, and there's no need to declare accessors and mutators. See [examples below](#examples). | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Escribir es borrar -- siempre decia Leandro Caniglia |
||
Designed to be schema-less, Mapless eliminates the need for schema maintenance and avoids any Object-Relational Mapping requirements. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tambien eliminaria el "Designed to be schema-less," -- ya lo dijiste en el parrafo anterior |
||
Mapless achieves a balance of maximum data survivability and robust architectural flexibility without imposing a heavy burden in terms of adoption and maintenance. | ||
|
||
## Features | ||
|
||
- Intuitive API for frictionless persistence. | ||
|
@@ -31,30 +40,33 @@ Schema-less persistence for Smalltalk with support for multiple backends. | |
- Enables smooth data migration/interoperation among backends. | ||
- ~~Via Redis PUB/SUB, scalable observer-pattern functionality across images.~~ In the roadmap. | ||
|
||
## Description | ||
|
||
Mapless is a schema-less persistence framework supporting multiple backends and offering a user-friendly API. For instance, querying Mapless objects involves a common family of methods, and there's no need to declare accessors and mutators. See [examples below](#examples). | ||
|
||
Designed to be schema-less, Mapless eliminates the need for schema maintenance and avoids any Object-Relational Mapping requirements. | ||
|
||
Mapless achieves a balance of maximum data survivability and robust architectural flexibility without imposing a heavy burden in terms of adoption and maintenance. | ||
|
||
## Ambition | ||
|
||
To deliver a high-performance solution that preserves arbitrary application state (data) with a focus on flexibility, availability, and capacity. It aims to strategically aid in scaling without causing backend vendor lock-in, across various persistence backends, and by neutralizing the costs associated with object-mapping impedance mismatch. | ||
|
||
## Supported backends | ||
|
||
1. MongoDB | ||
2. Redis | ||
3. Memory | ||
4. PostgreSQL | ||
5. ~~UnQLite~~ `deprecated` / retiring soon | ||
1. SQLite | ||
2. PostgreSQL | ||
3. Redis | ||
4. MongoDB | ||
5. Memory | ||
6. ~~UnQLite~~ `deprecated` / retiring soon | ||
|
||
## Examples | ||
Try Mapless by [installing it in a supported Pharo image](#install) and the following snippets: | ||
|
||
```Smalltalk | ||
"Instanciates a mapless object." | ||
"Instantiates an SQLite Mapless repository." | ||
repository := MaplessSQLiteRepository | ||
for: 'TryMapless' | ||
on: 'path/string/to/your/sqlite.db'. | ||
``` | ||
|
||
```Smalltalk | ||
"Custom class to model your data" | ||
Mapless subclass: #Person | ||
instanceVariableNames: '' | ||
classVariableNames: '' | ||
package: 'YourApp-Mapless' | ||
|
||
"Instantiates a Mapless object." | ||
philosopher := Person new | ||
firstName: 'Aristotle'; | ||
yourself. | ||
|
@@ -75,31 +87,33 @@ allOrEmpty := repository findAll: Person. | |
|
||
```Smalltalk | ||
"Query to load all the instances that match the condition." | ||
someOrEmpty := repository findAll: Person where: [ :each | each lastName = 'Peterson' ]. | ||
someOrEmpty := repository findAll: Person where: [ :each | | ||
each firstName = 'Aristotle' ]. | ||
``` | ||
|
||
```Smalltalk | ||
"Conditionally loading the first matching instance." | ||
oneOrNil := repository findOne: Person where: [ :each | each lastName = 'Peterson' ]. | ||
oneOrNil := repository findOne: Person where: [ :each | | ||
each firstName = 'Aristotle' ]. | ||
``` | ||
|
||
```Smalltalk | ||
"Create a Person mapless model" | ||
"Create a Person Mapless model" | ||
philosopher := Person new | ||
firstName: 'Aristotle'; | ||
save. | ||
|
||
"Set it as the person for a new User mapless model" | ||
"Set it as the person for a new User Mapless model" | ||
philosopherUser := User new | ||
person: philosopher; | ||
save. | ||
|
||
"Query for that user by ID and get its person instance" | ||
aristotle := (User findId: philosopherUser id) person. | ||
``` | ||
## Installation | ||
## Install | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mmhh "How to Install" o "Installation" me suenan mejor, no se. |
||
Open a workspace in a supported Pharo image and evaluate: | ||
To start with Mapless, download Pharo, open a Pharo Playground and evaluate: | ||
|
||
```smalltalk | ||
Metacello new | ||
|
@@ -110,7 +124,7 @@ Metacello new | |
|
||
## Include as dependency | ||
|
||
In BaselineOf or ConfigurationOf it can be added in this way: | ||
To include Mapless as a dependency from BaselineOf or ConfigurationOf add it with: | ||
|
||
```smalltalk | ||
spec | ||
|
@@ -119,3 +133,6 @@ spec | |
repository: 'github://sebastianconcept/Mapless:latest/src'; | ||
load: #('Core' 'Postgres' 'Mongo' 'Redis' 'Memory') ] | ||
``` | ||
## Project Ambition | ||
|
||
To deliver a high-performance solution that preserves arbitrary application state (data) with a focus on flexibility, availability, and capacity. It aims to strategically aid in scaling without causing vendor lock-in, across various persistence backends, and by neutralizing the costs associated with object-mapping impedance mismatch. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,10 @@ BaselineOfMapless >> baseline: spec [ | |
group: 'Mongo' with: #('Mapless-Mongo-Tests'); | ||
group: 'Redis' with: #('Mapless-Redis-Tests'); | ||
group: 'Postgres' with: #('Mapless-Postgres-Tests'); | ||
group: 'SQLite' with: #('Mapless-SQLite-Tests'); | ||
group: 'UnQLite' with: #('Mapless-UnQLite-Tests'); | ||
group: 'Benchmark' with: #('Mapless-Benchmark-Core'); | ||
group: 'default' with: #('Memory' 'Mongo') ] | ||
group: 'default' with: #('Memory' 'SQLite') ] | ||
] | ||
|
||
{ #category : #baseline } | ||
|
@@ -69,9 +70,11 @@ BaselineOfMapless >> setUpBasePackages: spec [ | |
|
||
{ #category : #baseline } | ||
BaselineOfMapless >> setUpMongoDependencies: spec [ | ||
spec | ||
baseline: 'MongoTalk' | ||
with: [ spec repository: 'github://pharo-nosql/mongotalk:1.25/mc' ] | ||
|
||
spec baseline: 'MongoTalk' with: [ | ||
spec | ||
repository: 'github://pharo-nosql/mongotalk:v2.0/mc'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To discuss why a specific version is needed here (v2.0) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fgarau as Mapless is used in production, all its dependencies need to be version pinned. Actually you reminded me we can pin a couple more! Thanks for commenting about it. PS: MongoTalk 2.0 is needed for accessing MongoDB from Pharo 10 and 10 |
||
loads: #( Client 'Mongo-DriverLegacy' ) ] | ||
] | ||
|
||
{ #category : #baseline } | ||
|
@@ -104,6 +107,9 @@ BaselineOfMapless >> setUpPackages: spec [ | |
self setUpPostgresDependencies: spec. | ||
self setUpPostgresPackages: spec. | ||
|
||
self setUpSQLiteDependencies: spec. | ||
self setUpSQLitePackages: spec. | ||
|
||
self setUpUnQLiteDependencies: spec. | ||
self setUpUnQLitePackages: spec | ||
] | ||
|
@@ -142,6 +148,25 @@ BaselineOfMapless >> setUpRedisPackages: spec [ | |
with: [ spec requires: #('Mapless-Redis-Core' 'Mapless-Tests-Base') ] | ||
] | ||
|
||
{ #category : #baseline } | ||
BaselineOfMapless >> setUpSQLiteDependencies: spec [ | ||
spec | ||
baseline: 'SQLite3' | ||
with: [ spec | ||
repository: 'github://pharo-rdbms/Pharo-SQLite3/src'; | ||
loads: #('Core') ] | ||
] | ||
|
||
{ #category : #baseline } | ||
BaselineOfMapless >> setUpSQLitePackages: spec [ | ||
spec | ||
package: 'Mapless-SQLite-Core' | ||
with: [ spec requires: #('Mapless-Base-Core' 'SQLite3') ]. | ||
spec | ||
package: 'Mapless-SQLite-Tests' | ||
with: [ spec requires: #('Mapless-SQLite-Core' 'Mapless-Tests-Base') ] | ||
] | ||
|
||
{ #category : #baseline } | ||
BaselineOfMapless >> setUpUnQLiteDependencies: spec [ | ||
spec | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me gusto el tag de la imagen "Obsenly simple object persistence" -- schema-less and offering support for multiple backends
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fgarau no te había preguntado pero justo estaba hablando sobre la tagline con @eMaringolo hace un ratito :)