Skip to content

johnmyleswhite/MySQL.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MySQL.jl

An interface to MySQL from Julia. Uses the C MySQL API and obeys the DBI.jl protocol.

Usage Example

using DBI
using MySQL

db = connect(MySQL5, "127.0.0.1", "username", "password", "dbname")

sql = "CREATE TABLE users (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255))"

stmt = prepare(db, sql)
execute(stmt)

try
    stmt = prepare(db, sql)
    execute(stmt)
end

errcode(db)
errstring(db)

rowid = lastinsertid(db)

stmt = prepare(db, "INSERT INTO users (name) VALUES ('Jeff Bezanson')")
execute(stmt)

stmt = prepare(db, "INSERT INTO users (name) VALUES ('Viral Shah')")
execute(stmt)

stmt = prepare(db, "INSERT INTO users (name) VALUES ('Stefan Karpinski')")
execute(stmt)

rowid = lastinsertid(db)

stmt = prepare(db, "DROP TABLE users")
execute(stmt)

disconnect(db)

Systems

  • Works on OS X

About

MySQL DBI driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages