Skip to content
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

Fix markdown headers. #772

Merged
merged 3 commits into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#### StorIO — modern API for SQLiteDatabase and ContentResolver

#####Overview:
##### Overview:
* Powerful & Simple set of Operations: `Put`, `Get`, `Delete`
* API for Humans: Type Safety, Immutability & Thread-Safety
* Convenient builders with compile-time guarantees for required params. Forget about 6-7 `null` in queries
Expand All @@ -16,7 +16,7 @@

----

#####Why StorIO?
##### Why StorIO?
* Simple concept of just three main Operations: `Put`, `Get`, `Delete` -> less bugs
* Almost everything is immutable and thread-safe -> less bugs
* Builders for everything make code much, much more readable and obvious -> less bugs
Expand All @@ -27,7 +27,7 @@
* `StorIO` has unit and integration tests [![codecov.io](https://codecov.io/github/pushtorefresh/storio/coverage.svg?branch=master)](https://codecov.io/github/pushtorefresh/storio?branch=master) -> less bugs
* Less bugs -> less bugs

####Documentation:
#### Documentation:

* [`Why we made StorIO`](https://engineering.pushtorefresh.com/2015/07/02/storio-modern-replacement-for-sqlitedatabase-and-contentresolver-apis/)
* [`StorIO SQLite`](docs/StorIOSQLite.md)
Expand All @@ -39,7 +39,7 @@ Easy ways to learn how to use `StorIO` -> check out `Documentation`, `Design Tes
* [Design tests for StorIO ContentResolver](storio-content-resolver/src/test/java/com/pushtorefresh/storio/contentresolver/design)
* [Sample App](storio-sample-app)

####Download:
#### Download:
```groovy
// If you need StorIO for SQLite
compile 'com.pushtorefresh.storio:sqlite:1.12.3'
Expand All @@ -56,9 +56,9 @@ compile 'com.pushtorefresh.storio:content-resolver:1.12.3'

You can find all releases on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.pushtorefresh.storio%22).

####Some examples
#### Some examples

#####Get list of objects from SQLiteDatabase
##### Get list of objects from SQLiteDatabase
```java
List<Tweet> tweets = storIOSQLite
.get()
Expand All @@ -73,7 +73,7 @@ List<Tweet> tweets = storIOSQLite

```

#####Put something to SQLiteDatabase
##### Put something to SQLiteDatabase
```java
storIOSQLite
.put() // Insert or Update
Expand All @@ -82,7 +82,7 @@ storIOSQLite
.executeAsBlocking();
```

#####Delete something from SQLiteDatabase
##### Delete something from SQLiteDatabase
```java
storIOSQLite
.delete()
Expand All @@ -95,9 +95,9 @@ storIOSQLite
.executeAsBlocking();
```

####Reactive? Observable.just(true)!
#### Reactive? Observable.just(true)!

#####Get something as rx.Observable and receive updates!
##### Get something as rx.Observable and receive updates!
```java
storIOSQLite
.get()
Expand All @@ -116,7 +116,7 @@ storIOSQLite
);
```

#####Want to work with plain Cursor, no problems
##### Want to work with plain Cursor, no problems
```java
Cursor cursor = storIOSQLite
.get()
Expand All @@ -130,8 +130,8 @@ Cursor cursor = storIOSQLite
.executeAsBlocking();
```

####How object mapping works?
#####You can set default type mappings when you build instance of `StorIOSQLite` or `StorIOContentResolver`
#### How object mapping works?
##### You can set default type mappings when you build instance of `StorIOSQLite` or `StorIOContentResolver`

```java
StorIOSQLite storIOSQLite = DefaultStorIOSQLite.builder()
Expand Down Expand Up @@ -254,7 +254,7 @@ API of `StorIOContentResolver` is same.

----

####Documentation:
#### Documentation:

* [`Why we made StorIO`](https://engineering.pushtorefresh.com/2015/07/02/storio-modern-replacement-for-sqlitedatabase-and-contentresolver-apis/)
* [`StorIO SQLite`](docs/StorIOSQLite.md)
Expand All @@ -268,7 +268,7 @@ Easy ways to learn how to use `StorIO` -> check out `Design Tests` and `Sample A

----

####Versioning:
#### Versioning:
Because StorIO works with important things like User data and so on, we use Semantic Versioning 2.0.0 scheme for releases (http://semver.org).

Short example:
Expand All @@ -280,14 +280,14 @@ Short example:

Please read [`CHANGELOG`](CHANGELOG.md) and check what part of the version has changed, before switching to new version.

####Architecture:
#### Architecture:
`StorIOSQLite` and `StorIOContentResolver` — are abstractions with default implementations: `DefaultStorIOSQLite` and `DefaultStorIOContentResolver`.

It means, that you can have your own implementation of `StorIOSQLite` and `StorIOContentResolver` with custom behavior, such as memory caching, verbose logging and so on or mock implementation for unit testing (we are working on `MockStorIO`).

One of the main goals of `StorIO` — clean API for Humans which will be easy to use and understand, that's why `StorIOSQLite` and `StorIOContentResolver` have just several methods, but we understand that sometimes you need to go under the hood and `StorIO` allows you to do it: `StorIOSQLite.Internal` and `StorIOContentResolver.Internal` encapsulates low-level methods, you can use them if you need, but please try to avoid it.

####Queries
#### Queries

All `Query` objects are immutable, you can share them safely.

Expand All @@ -296,16 +296,16 @@ You may notice that each Operation (Get, Put, Delete) should be prepared with `p

You can customize behavior of every Operation via `Resolvers`: `GetResolver`, `PutResolver`, `DeleteResolver`.

####Rx Support Design
#### Rx Support Design
Every Operation can be executed as `rx.Observable`, `rx.Single` or `rx.Completable`. Get Operations will be automatically subscribed to the updates of the data.
Every Observable runs on `Schedulers.io()`, in v2.0 we will remove default scheduling!

####3rd party additions/integrations for StorIO
#### 3rd party additions/integrations for StorIO

* [CodeGenUnderStorIO](https://github.com/shivan42/CodeGenUnderStorIO) allows you generate Java classes for db entities from the db schema built in some visual editor.

----
Master branch build status: [![Master branch build status](https://travis-ci.org/pushtorefresh/storio.svg?branch=master)](https://travis-ci.org/pushtorefresh/storio)


**Made with love** in [Pushtorefresh.com](https://pushtorefresh.com) by [@artem_zin](https://twitter.com/artem_zin) and [@nikitin-da](https://github.com/nikitin-da)
**Made with love** in [Pushtorefresh.com](https://pushtorefresh.com) by [@artem_zin](https://twitter.com/artem_zin), [@nikitin-da](https://github.com/nikitin-da) and [@geralt-encore](https://github.com/geralt-encore)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😊

38 changes: 19 additions & 19 deletions docs/StorIOContentResolver.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
###StorIOContentResolver — API for Content Resolver
### StorIOContentResolver — API for Content Resolver

Important notice: All StorIO APIs looks same, if you know how to work with StorIOSQLite -> you know how to work with StorIOContentResolver!

####0. Create an instance of StorIOContentResolver
#### 0. Create an instance of StorIOContentResolver

```java
StorIOContentResolver storIOContentResolver = DefaultStorIOContentResolver.builder()
Expand All @@ -13,8 +13,8 @@ StorIOContentResolver storIOContentResolver = DefaultStorIOContentResolver.build

It's a good practice to use one instance of `StorIOContentResolver` per application, but it's not required.

####1. Get Operation
######Get list of objects with blocking call:
#### 1. Get Operation
###### Get list of objects with blocking call:

```java
final List<Tweet> tweets = storIOContentResolver
Expand All @@ -29,7 +29,7 @@ final List<Tweet> tweets = storIOContentResolver
.executeAsBlocking();
```

######Get `Cursor` via blocking call:
###### Get `Cursor` via blocking call:

```java
final Cursor tweetsCursor = storIOContentResolver
Expand All @@ -46,9 +46,9 @@ final Cursor tweetsCursor = storIOContentResolver

Things become much more interesting with `RxJava`!

#####What if you want to observe changes in `StorIOContentResolver`?
##### What if you want to observe changes in `StorIOContentResolver`?

######First-case: Receive updates to `Observable` on each change of Uri from `Query`
###### First-case: Receive updates to `Observable` on each change of Uri from `Query`

```java
storIOContentResolver
Expand All @@ -70,7 +70,7 @@ storIOContentResolver
// don't forget to manage Subscription and unsubscribe in lifecycle methods to prevent memory leaks
```

######Second case: Handle changes manually
###### Second case: Handle changes manually

```java
storIOContentResolver
Expand All @@ -80,7 +80,7 @@ storIOContentResolver
});
```

######Get result via Rx only once and ignore further changes
###### Get result via Rx only once and ignore further changes

```java
storIOContentResolver
Expand All @@ -99,7 +99,7 @@ storIOContentResolver
);
```

######Customize behavior of `Get` Operation with `GetResolver`
###### Customize behavior of `Get` Operation with `GetResolver`

```java
GetResolver<Type> getResolver = new DefaultGetResolver()<Type> {
Expand All @@ -122,9 +122,9 @@ Several things about `Get` Operation:
* As you can see, results of `Get` Operation computed even if you'll apply `RxJava` operators such as `Debounce`, if you want to avoid unneeded computations, please combine `StorIOContentResolver.observeChangesOfUri()` with `Get` Operation manually.
* In next versions of `StorIO` we are going to add `Lazy<T>` to allow you skip unneeded computations

####2. Put Operation
#### 2. Put Operation

######Put object of some type
###### Put object of some type
```java
Tweet tweet = getSomeTweet();

Expand All @@ -135,7 +135,7 @@ storIOContentResolver
.executeAsBlocking(); // or asRxObservable()
```

######Put multiple objects of some type
###### Put multiple objects of some type
```java
List<Tweet> tweets = getSomeTweets();

Expand All @@ -146,7 +146,7 @@ storIOContentResolver
.executeAsBlocking(); // or asRxObservable()
```

######Put `ContentValues`
###### Put `ContentValues`
```java
ContentValues contentValues = getSomeContentValues();

Expand Down Expand Up @@ -188,9 +188,9 @@ Several things about `Put` Operation:
* `Put` Operation requires `PutResolver`
* Result of `Put` Operation can be useful if you want to know what happened: insert (and insertedId) or update (and number of updated rows)

####3. Delete Operation
#### 3. Delete Operation

######Delete object
###### Delete object
```java
Tweet tweet = getSomeTweet();

Expand All @@ -201,7 +201,7 @@ storIOContentResolver
.executeAsBlocking(); // or asRxObservable()
```

######Delete multiple objects
###### Delete multiple objects
```java
List<Tweet> tweets = getSomeTweets();

Expand Down Expand Up @@ -229,8 +229,8 @@ DeleteResolver<SomeType> deleteResolver = new DefaultDeleteResolver<SomeType>()
Several things about `Delete` Operation:
* Result of `Delete` Operation can be useful if you want to know what happened

####How object mapping works?
#####You can set default type mappings when you build instance of `StorIOContentResolver`
#### How object mapping works?
##### You can set default type mappings when you build instance of `StorIOContentResolver`

```java
StorIOContentResolver storIOContentResolver = DefaultStorIOContentResolver.builder()
Expand Down
Loading