Available
amalgame-mysql
Dynamic-link binding to libmariadb. MariaDB ≥ 10.x and MySQL ≥ 5.7.
Overview
The MariaDB client is wire-protocol compatible with MySQL. The package links to the system's libmariadb, which talks to both MariaDB and a recent MySQL equally well.
Features
- ✓MariaDB ≥ 10.x and MySQL ≥ 5.7 compatible (shared wire protocol)
- ✓
MySQL.Open(host, port, user, password, db),Exec,QueryAll,LastInsertId - ✓
?parameters sent throughlibmariadbprepared statements,Begin/Commit/Rollbacktransactions - ✓Dynamic-link pattern — no vendored fork to maintain
Planned
- ◐TLS settings in the API
- ◐Typed column accessors: today every cell comes back as text
- ◐Multiple result sets and async queries
- ◐Stored-procedure OUT parameters
Example
Minimal usage example — copy-paste runnable after install.
import Amalgame.Database.MySQL
public class Program {
public static void Main() {
let db = MySQL.Open("127.0.0.1", 3306, "app", "secret", "shop")
if (!MySQL.IsOpen(db)) {
Console.WriteLine("connect failed: " + MySQL.LastError(db))
return
}
let params = new List<string>()
params.Add("42")
let rows = MySQL.QueryBindAll(db, "SELECT id, total FROM orders WHERE customer_id = ?", params)
for row in rows {
Console.WriteLine(row.Get(0) + " : " + row.Get(1))
}
MySQL.Close(db)
}
}
At a glance
- License: Apache-2.0
- Install:
amc package add mysql - Source: amalgame-lang/amalgame-database-mysql
- Official index: amalgame-lang/packages-index