Skip to content

brokenhandsio/steampress-fluent-mysql

Repository files navigation

SteamPress

Language Build Status Code Coverage MIT License

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

Usage:

Add the package to your Package.swift dependencies:

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

In configure.swift add the SteamPress Fluent MySQL provider:

import SteampressFluentMysql

// ...

let provider = SteamPressFluentMysqlProvider()
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: .mysql)
migrations.add(model: BlogUser.self, database: .mysql)
migrations.add(model: BlogPost.self, database: .mysql)
migrations.add(model: BlogPostTagPivot.self, database: .mysql)
// 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: .mysql)
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:

About

Fluent MySQL adapters for SteamPress

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published