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

How to install this API #39

Open
pongy20 opened this issue Feb 13, 2019 · 4 comments
Open

How to install this API #39

pongy20 opened this issue Feb 13, 2019 · 4 comments

Comments

@pongy20
Copy link

pongy20 commented Feb 13, 2019

Hey,

I am new to Swift and want to use my MySQL Database. I found this Api and it sounds great to connect to my database without creating a PHP File on my Server.

Now the question... how can I exactly install / implement this to my Code? Where can I download it? How to I implement it into Xcode?

Hopefully somebody will see my Issue :) and is ready to take some time and helps me. I'll be very happy :). Please...

@tuanbavns
Copy link

same question above??? I dont find anything else

@Napoleon-BlownApart
Copy link

Napoleon-BlownApart commented Aug 3, 2019

I'm not a Swift expert by any means, but I was able to get MySQLSwiftNative working in a fresh (Swift 5.0.1/Xcode 10.2) project I created. I haven't yet tested the full range of the MySQLDriver.framework's features and functions, so there may be some other issues down the road I haven't gotten to.

What I did was:
In MySQLSwiftNative

  1. Update the MySQLSwiftNative project to use Swift tools version 4 swift package tools-version --set 4.0.0
  2. Added meta-data to Package.swift to output a Product and Target. Below is the final version of Package.swift (which includes the result of step 1 above):

`

// swift-tools-version:4.0
import PackageDescription

let package = Package(
    name: "MySQLDriver",
    products: [
        .library(name: "MySQLDriver", targets: ["MySQLDriver"])
    ],
    dependencies: [
    ],
    targets: [
        .target(name: "MySQLDriver", path: "Sources"),
    ]
)
  1. Added public to the declarations of create (twice) in the Table.swift file. (This step may not be quite right, but it quickly fixed a scope issue.)

In my new project
4) Added a stanza to the new project's Package.swift file to indicate the dependency on 'MySQLDriver':

`

dependencies: [
  .package(
    path: "/Users/user/Programming/MySQL/MySqlSwiftNative"
  )
],
  1. and updated my project's target to also depend on "MySQLDriver".
  2. Ran swift package generate-xcodeproj inside my project's root folder.
  3. Since my project has a main.swift file, I copied the sample code from the MySQLSampleOSX/main.swift file into my main.swift, added import MySQLDriver at the beginning and built/ran my project.

@pongy20
Copy link
Author

pongy20 commented Aug 16, 2019

Thank you very much !!! <3

@zebatista
Copy link

Hello,
My experience is in VB.NET, I moved to Mac now.
I am trying to learn Xcode and Swift and I would also like to be able to install it.
But I am in a lot of difficulties. I needed more details on the installation.
Someone available to help?
Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants