Closed sonygod closed 4 years ago
import tink.sql.Types;
typedef Customer = {
@:autoIncrement @:primary public var id(default, null):Id<Customer>;
public var avatar(default, null):VarChar<50>;
public var nickname(default, null):VarChar<50>;
public var user_login(default, null):VarChar<50>;
public var openid(default, null):VarChar<50>;
public var money(default, null):Float;
public var last_login_ip(default, null):VarChar<50>;
public var club_id(default, null):Int;
public var mobile(default, null):VarChar<11>;
public var coins(default, null):Float;
public var staticCoins(default, null):Float;
public var referenceID(default, null):Float;
public var level(default, null):Int;
}
class Db extends tink.sql.Database {
@:table("fa_customer") var user:Customer;
}
//------------------------------
static function testUpdate() {
return db.user.update(function (u) return [u.money.set(u.money+10000)],{where:function (u) return u.id>5140});
}
//---dump sql
UPDATE `fa_customer` SET`money` = (`user`.`money` + 10000) WHERE (`user`.`id` > 5140)
Summary: Query builder didn't pick up the table name specified in @:table
Same for inserts
Closed in 9ddc2be
///
// -D sql_debug