vapor-docs/3.0/docs/databases/mysql/package.md

1.9 KiB

Using MySQL

The vapor/mysql package is a lightweight, async pure swift MySQL/MariaDB driver. It provides an intuitive Swift interface for working with MySQL that can be used with any Swift project.

Just MySQL

This package was built to be a powerful interface for MySQL. To include this MySQL package in your project, simply add it to your Package manifest.

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "Project",
    dependencies: [
        ...
        .package(url: "https://github.com/vapor/mysql.git", .upToNextMajor(from: "3.0.0")),
    ],
    targets: [
      .target(name: "Project", dependencies: ["MySQL", ... ])
    ]
)

If this is your first time adding a dependency, you should read our introduction to Package.swift.

Use import SQLite to access the Swift SQLite APIs.