This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from skobkin/feature_postgresql_support
[Partial] PostgreSQL support for magneticod
- Loading branch information
Showing
5 changed files
with
420 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,33 @@ | |
[![GoDoc](https://godoc.org/github.com/boramalper/magnetico?status.svg)](https://godoc.org/github.com/boramalper/magnetico) | ||
|
||
- The most significant package is `persistence`, that abstracts access to the | ||
magnetico databases with different engines (currently, only SQLite). | ||
magnetico databases with different engines (currently, SQLite, stdout and partly PostgreSQL). | ||
|
||
**For REST-ful magneticow API, see [https://app.swaggerhub.com/apis/boramalper/magneticow-api/](https://app.swaggerhub.com/apis/boramalper/magneticow-api/).** | ||
|
||
## PostgreSQL database engine (only `magneticod` part implemented) | ||
|
||
PostgreSQL database engine uses [PostgreSQL](https://www.postgresql.org/) to store indexed | ||
torrents. It's more performant and flexible than SQLite but requires additional software configuration. | ||
|
||
**WARNING:** `pg_trgm` extension required. You need to enable it for your database before starting `magneticod`: | ||
|
||
```postgresql | ||
CREATE EXTENSION pg_trgm; | ||
``` | ||
|
||
Engine usage example: | ||
|
||
```shell | ||
magneticod --database=postgres://username:[email protected]:5432/database?schema=custom_schema_name&sslmode=disable | ||
``` | ||
|
||
See [pgx repository](https://github.com/jackc/pgx/blob/master/stdlib/sql.go) | ||
for more examples. | ||
|
||
Optional parameter `schema` was added to choose which schema will be used to store magnetico tables, | ||
sequences and indexes. | ||
|
||
## Stdout Dummy Database Engine for magneticod | ||
|
||
Stdout dummy database engine for **magneticod** prints a new [JSON Line](http://jsonlines.org/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.