Code Monkey home page Code Monkey logo

mysql-connector-erlang's Introduction

mysql-connector-erlang

  • erlang mysql connector in single file
  • connect/query/handle by single process
  • support version 4.1 or later (8.x caching_sha2_password plugin supported)
  • arguments pass by tuple list(config file compatibility) instead maps(otp 17 early supported)
  • nice pool compatibility
  • quick and easy to integrate in your project

quick start

  • Add to rebar.config
{deps, [
  ...
  {mysql_connector, {git, "https://github.com/QCute/mysql-connector-erlang.git", {branch, "master"}}}
]}.
  • Add mysql_connector.app start
application:start(mysql_connector).
  • start in project
ConnectorArgs = [{host, "localhost"}, {port,3306}, {user,"root"}, {password,"root"}, {database,"test"}, {encoding, "utf8mb4"}],
{ok, Pid} = mysql_connector:start_link(ConnectorArgs),
mysql_connector:select("select 1", Pid).
ConnectorArgs = [{host, "localhost"}, {port, 3306}, {user, "root"}, {password, "root"}, {database, "test"}], 
PoolArgs = [{worker, {mysql_connector, start_link, [ConnectorArgs]}}, {size, 4}],
%% example use volley 
volley:start_pool(mysql_connector, PoolArgs).
Worker = volley:get(mysql_connector),
mysql_connector:select("select 1", Worker).

Performance

Driver Test 1 Test 2 Test 3
mysq-connector 636052 630514 615399
mysql-otp 1220338 1011661 987828
Emysql 640698 671094 653903
mysql 982400 838034 836162
p1_mysql 1146160 1091125 1051280

mysql-connector-erlang's People

Contributors

qcute avatar

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.