Giter VIP home page Giter VIP logo

perfect-mariadb's Introduction

Perfect - MariaDB Connector 简体中文

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 5.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

This project provides a Swift wrapper around the MariaDB client library, enabling access to MariaDB database servers.

This package builds with Swift Package Manager and is part of the Perfect project. It was written to be stand-alone and so does not require PerfectLib or any other components.

Ensure you have installed and activated the latest Swift tool chain.

OS X Build Notes

To install MariaDB connector:

brew install mariadb-connector-c

Linux Build Notes

Tests performed on Ubuntu 18.04. Prior to building this library, please ensure you install the required MariaDB library:

sudo apt-get install pkg-config libmariadb-dev  

On older distros (like 16.04), you may need to install libmariadb-client-lgpl-dev instead of libmariadb-dev. On older versions, you will also need to create a pkg-config file. In such cases, create /usr/lib/pkgconfig/libmariadb.pc and make it look something like this:

libdir=/usr/lib/x86_64-linux-gnu
includedir=/usr/include/mariadb

Name: libmariadb
Description: MariaDB Connector/C
Version: 5.5.0
Requires:
Cflags: -I${includedir}
Libs: -L${libdir} -lmariadb
Libs.private: -ldl -lm -lpthread

To test if pkg-config is working, try running the command:

pkg-config libmariadb --cflags --libs

Building

Add this project as a dependency in your Package.swift file.

.package(url:"https://github.com/PerfectlySoft/Perfect-MariaDB.git", from: "3.0.0")
...
dependencies: ["MariaDB"]),

Import required libraries:

import MariaDB
import PerfectCRUD

Perfect-MariaDB supports the Perfect-CRUD protocol. Please check Perfect-CRUD for more information.

Further Information

For more information on the Perfect project, please visit perfect.org.

perfect-mariadb's People

Contributors

bo98 avatar iamjono avatar kjessup avatar rockfordwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

perfect-mariadb's Issues

macOS / Swift : Facing issue when trying to integrate with Xcode project using SPM

There are two error which I am facing when trying to run after adding "https://github.com/PerfectlySoft/Perfect-MariaDB" as package using SPM.

When I run this, App crashes with following errors:

  1. '/Users/gaganaks/Library/Developer/Xcode/DerivedData/MariaDBPOC-ahlzpxfyaavjfkdwgbmglqqgffbj/Build/Products/Debug/libmariadb.3.dylib' (no such file), '/usr/lib/system/introspection/libmariadb.3.dylib' (no such file, not in dyld cache), '/opt/homebrew/opt/mariadb-connector-c/lib/mariadb/libmariadb.3.dylib' (code signature in
  2. '/opt/homebrew/Cellar/mariadb-connector-c/3.3.5_1/lib/mariadb/libmariadb.3.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/mariadb-connector-c/lib/mariadb/libmariadb.3.dylib' (no such file)

Can someone please provide a way to properly integrate this with existing Xcode project?

Swift Compiler Warning

I got a Swift Compiler Warning:
Perfect-MariaDB-master/Sources/MariaDB/MySQLStmt.swift:288:17: Initialization of 'UnsafeRawPointer' results in a dangling pointer

The code is as below.

private func allocated(_ a: [Int8]) -> UnsafeMutableRawBufferPointer? {
	let buffer = UnsafeMutableRawBufferPointer.allocate(byteCount: a.count, alignment: 0)
    let u = UnsafeRawPointer(a)
    if let p = buffer.baseAddress {
		memcpy(p, u, a.count)
	}
	return buffer
}

My OS X is 10.15.5 and Xcode version is 11.5.

Please help. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.