rcd27
07/05/2021, 5:17 PMExposed
? Or should I just use plain old Java interface for that? I have these one: (just trying to implement full-text-search in postgres)Antonio Acuña Prieto
07/11/2021, 6:20 PMDamien
07/12/2021, 4:45 PMselect sum(subQuery.myCol + subQuery.myCol) from (select col as myCol) subQuery
I have my subselect working, have my column alias working, I can select by the alias (e.g. select subQuery.myCol from (select...)
). But I cannot figure out how to construct further functions from the aliased columns.
I essentially have multiple aliased columns in a subselect and I wish to multiply them in some way and query the result. Appreciate any insight! No idea where to start (QueryBuilder?)Ali Olfat
07/13/2021, 9:51 PMJgafner
07/14/2021, 12:01 PMselect *
from regression_notifications rn
join notification_checks nc on rn.id = nc.regression_id
join check_issues ci on nc.id = ci.check_id
where ci.status = "Open"
I tried:
RegressionTable.join(CheckTable.join( IssueTable,JoinType.INNER),JoinType.INNER).select { IssueTable.status eq "Open" }
but it return different results
thanksAustin Paquette
07/17/2021, 2:44 PMNayeem Zen
08/09/2021, 6:19 PMTrevor Merritt
08/17/2021, 11:52 AMTwoClocks
08/17/2021, 9:14 PMLbenyehu
08/18/2021, 12:39 PMcodec
08/22/2021, 3:54 AMAlex
08/26/2021, 2:35 PMDas135
09/02/2021, 9:24 AMtransaction {}
blocks. It is possible? Thank you!hfhbd
09/07/2021, 2:19 PMselect name, min(time), max(time) from data group by name
In https://github.com/JetBrains/Exposed/wiki/DSL#group-by there is no good sampleMrPowerGamerBR
09/12/2021, 3:37 AMException in thread "main" org.jetbrains.exposed.exceptions.UnsupportedByDialectException: Auto-increment could be applied only to primary key column, dialect: sqlite.
Here's the table:
object Abc : LongIdTable() {
val user = long("user")
val user2 = long("user2")
override val primaryKey = PrimaryKey(id, user, user2)
}
So... is that an Exposed issue? Because I have no idea why it thinks it is a auto increment column. The only auto increment column is the "id" but it is also being included as a PrimaryKeydave08
09/13/2021, 11:37 AMIsaacMart
09/14/2021, 3:40 AM@Entity(tableName = "requests")
public class Request extends BaseObservable implements Parcelable {
@PrimaryKey(autoGenerate = true)
private int request_id;// Document_id
private String r_clients_id;
private int r_tasker_id;
private User user;// Type converter
private String requested_skill;
private String time_stamp;
}
Same model for my ktor project
class Request(
val request_id: Int,
val r_clients_id: Int,
val r_tasker_id: Int,
val user: User,
val requested_skill: String,
val time_stamp: String,
val arrival_date: String,
): Serializable, Principal
Here is where am facing the challenge. I really don't know how to insert or reference the Type converter class in my object class.I am new to ktor and exposed.
object Requests : Table() {
val requestId: Column<Int> = integer("request_id").autoIncrement().primaryKey()
val rClientId: Column<Int> = integer("r_clients_id").references(Users.userId)
val rTaskerId: Column<Int> = integer("r_tasker_id").references(Taskers.taskerId)
val user: Column<User> = ?????????????????????????
val requestedSkill = varchar("requested_skill", 128)
val timeStamp = varchar("time_stamp", 64)
val arrivalDate = varchar("arrival_date", 64)
}
edwinRNDR
09/14/2021, 10:17 AMBorzdeG
09/16/2021, 6:13 AMEndre Deak
09/22/2021, 7:29 PMnullium21
09/27/2021, 4:33 PMclass LogChannel(id: EntityID<Long>): LongEntity(id) {
companion object : LongEntityClass<LogChannel>(LogChannels)
val guild by GuildConfig referencedOn LogChannels.guild
}
object LogChannels: LongIdTable() {
val guild = reference("guild", GuildConfigs)
}
and an empty GuildConfig
entity + GuildConfigs
table
how can i have the GuildConfig
have a list of all `LogChannel`s that point to it?
i've tried this:
val foos by LogChannel via LogChannels
but it says "`Table does not reference target`"dave08
09/29/2021, 10:09 AMKotlinInstantColumnType
can handle an int field that stores a unix timestamp?dave08
09/29/2021, 10:15 AMInt
, it should use Instant.fromEpochSeconds
to convert it...dave08
09/30/2021, 11:32 AMSchema.create
only creates my tables once when running h2 in memory dbs in my tests, I need to recreate the connection and tables for each test, but it doesn't do it after the first time... and then all the following tests fail...Łukasz Bednarczyk
09/30/2021, 12:22 PMjoseph_ivie
10/05/2021, 9:32 PMAmaan
10/08/2021, 2:02 PMJohn Pali
10/15/2021, 3:28 PMID | User | value
1 | 1 | value1
2 | 1 | value2
3 | 2 | value3
In other ORM frameworks, if I want to extract only values from user=1, I could create a DB session and use Values.all()
and it'll fetch only [value1, value2]
I don't want to fetch via Values.select { Values.user eq user }
Bert Heyman
10/21/2021, 9:40 AMnilTheDev
10/21/2021, 4:31 PM