我有当前的表:
create table Tokens (
token varchar(256) not null,
duser varchar(32) not null,
type varchar(16) not null,
expires_in datetime not null,
auth_time datetime not null,
primary key(token),
foreign key(duser) references User(id)
);
我想在下面进行查询:
select * from Tokens where duser = "myid" and expires_in > current_timestamp
--or something to compare if expires_in is greater than the current date **and** time
但我正在使用Exposed。我已经做了这个:
return transaction {
Database.TOKENS.run {
select {
(user eq this@DogoUser.id) and (expiresIn greater) //stopped here
}
}
}
如何通过current_timestamp
Jetbrains Exposed 引用 MySQL 变量?