Skip to content

nakagami/TinyMySQL.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyMySQL.jl

A Julia interface to the MySQL/MariaDB.

It follows the interface of DBInterface https://github.com/JuliaDatabases/DBInterface.jl .

MySQL Connector/C or MariaDB Connector/C is not required.

Example

using TinyMySQL, DBInterface
conn = DBInterface.connect(TinyMySQL.Connection, host, user, password, db="databse_name")

# execute
DBInterface.execute(conn, "INSERT INTO some_tbale(...) VALUES (...)")

res = columntable(DBInterface.execute("SELECT * FROM some_table"))

Restriction

  • The database encoding only supports utf8.

  • Not implement bellow example.

# execute with parameter
res = columntable(DBInterface.execute("SELECT * FROM some_table where some_column=?", (1, )))

# prepared statement and execute
stmt = DBInterface.prepare(conn, raw"SELECT * FROM some_table")
res = columntable(DBInterface.execute(stmt))

# prepared statement and execute with parameter
stmt = DBInterface.prepare(conn, raw"SELECT * FROM some_table where some_column=?")
res = columntable(DBInterface.execute(stmt, (1, )))

About

Julia MySQL driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages