2012-08-15 34 views

Trả lời

12

Bạn có thể sử dụng SQLJocky để kết nối với MySQL. Thêm

dependencies: 
    sqljocky: 0.0.4 

để bạn pubspec.yaml một chạy quán rượu cài đặt. Bây giờ bạn có thể kết nối với MySQL như thế này

var cnx = new Connection(); 
cnx.connect(username, password, dbName, port, hostname).then((nothing) { 
    // Do something with the connection 
    cnx.query("show tables").then((Results results) { 
    print("tables"); 
    for (List row in results) { 
     print(row); 
    } 
    }); 
}); 
Các vấn đề liên quan