Home

Awesome

<p align="center"> <img src="https://user-images.githubusercontent.com/9938337/29742058-ed41dcc0-8a6f-11e7-9cfc-680501cdfb97.png" alt="SteamPress"> <br> <br> <a href="https://swift.org"> <img src="http://img.shields.io/badge/Swift-5.1-brightgreen.svg" alt="Language"> </a> <a href="https://github.com/brokenhandsio/steampress-fluent-postgres/actions"> <img src="https://github.com/brokenhandsio/steampress-fluent-postgres/workflows/CI/badge.svg?branch=master" alt="Build Status"> </a> <a href="https://codecov.io/gh/brokenhandsio/steampress-fluent-postgres"> <img src="https://codecov.io/gh/brokenhandsio/steampress-fluent-postgres/branch/master/graph/badge.svg" alt="Code Coverage"> </a> <a href="https://raw.githubusercontent.com/brokenhandsio/steampress-fluent-postgres/master/LICENSE"> <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"> </a> </p>

Steampress Fluent Postgres provides Fluent PostgreSQL adapters for SteamPress to allow you to use SteamPress with a PostgreSQL database.

Usage:

Add the package to your Package.swift dependencies:

dependencies: [
    ...,
    .package(name: "SteampressFluentPostgres", url: "https://github.com/brokenhandsio/steampress-fluent-postgres.git", from: "1.0.0"),
]

In configure.swift add the SteamPress Fluent Postgres provider:

import SteampressFluentPostgres

// ...

let provider = SteamPressFluentPostgresProvider()
try services.register(provider)

You also need to add the migrations for the different database models to your MigrationConfig:

var migrations = MigrationConfig()
// ...
migrations.add(model: BlogTag.self, database: .psql)
migrations.add(model: BlogUser.self, database: .psql)
migrations.add(model: BlogPost.self, database: .psql)
migrations.add(model: BlogPostTagPivot.self, database: .psql)
// This will create an admin user so you can log in! The password will be printed out when created.
migrations.add(migration: BlogAdminUser.self, database: .psql)
services.register(migrations)

This ensures the tables are created for use next time your app boots up.

For details on how to use SteamPress and the required templates see the main SteamPress README.

Configuration

You can configure the provider with the following optional configuration options: