Skip to content

Conversation

bogdan-evtushenko
Copy link

No description provided.

Copy link
Member

@yev-kanivets yev-kanivets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm 👍See comments for some questions / remarks.

app/build.gradle Outdated
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"

implementation "com.squareup.okhttp3:logging-interceptor:4.2.1"
implementation "com.squareup.sqldelight:android-driver:1.2.1"

This comment was marked as resolved.

@@ -0,0 +1,80 @@
{

This comment was marked as resolved.

private lateinit var pageTitle: String
private lateinit var link: String

private val problem: Problem

This comment was marked as resolved.

}
}
DatabaseClient.userDao.update(user)
withContext(Dispatchers.IO) {

This comment was marked as resolved.


jvmMain {
dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

This comment was marked as resolved.

) {
fun identify() = "$contestId$index"

fun copy(id: Long = this.id, name: String = this.name, enName: String = this.enName, ruName: String = this.ruName, index: String = this.index, contestId: Long = this.contestId, contestName: String = this.contestName, contestTime: Long = this.contestTime, isFavourite: Boolean = this.isFavourite) =

This comment was marked as resolved.

import kotlinx.serialization.Serializable

@Serializable
class Problem(

This comment was marked as resolved.


lateinit var sqlDriver: SqlDriver

/*val store = Store(

This comment was marked as resolved.

@@ -0,0 +1 @@
CREATE TABLE Contest (id INTEGER NOT NULL, name TEXT NOT NULL, time INTEGER NOT NULL, phase TEXT NOT NULL, PRIMARY KEY(id))
Copy link
Member

@yev-kanivets yev-kanivets Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If migrations doesn't work in the current version, it's better to remove them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to say if migrations. But yes, I'm almost sure these migrations aren't needed. Can you check?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They work, otherwise, how I install application to old version db and everything work?

SELECT * FROM User;

insert:
INSERT OR REPLACE INTO User(avatar, rank, handle, rating, maxRating, firstName, lastName, ratingChanges) VALUES(?,?,?,?,?,?,?,?);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've see that you have if for 2 inserts, but they both are INSERT OR REPLACE, so not sure you can't get rid of one.

Copy link
Author

@bogdan-evtushenko bogdan-evtushenko Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first one really insert User, second one - update. They are different, because second one have 'id' parametre, unlike first one.

Copy link
Member

@yev-kanivets yev-kanivets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job 👍

@bogdan-evtushenko bogdan-evtushenko merged commit ed9cc3c into dev Mar 13, 2020
@bogdan-evtushenko bogdan-evtushenko deleted the 99-kmp branch March 20, 2020 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants