https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
squarelibraries
  • j

    jw

    11/10/2020, 2:52 AM
    reading is more complicated
    val bufferedSource = source().buffer()
    val cipher = try {
      val ivSize = bufferedSource.readInt()
      val iv = bufferedSource.readByteArray(ivSize.toLong())
      getDecryptionCipher(iv)
    } catch (e: IOException) {
      try {
        bufferedSource.close()
      } catch (inner: IOException) {
        e.addSuppressed(inner)
      }
      throw e
    }
    return bufferedSource.cipherSource(cipher)
    c
    • 2
    • 1
  • d

    dimsuz

    11/17/2020, 4:42 PM
    Quick sqldelight question: if i run DELETE query which deletes 0 rows, will my reactive listeners fire? Or actual change need to happen for them to fire?
    a
    • 2
    • 1
  • v

    Vailo Tok

    11/18/2020, 1:21 AM
    Hi everyone, does anyone use square's workflow in the project?
    z
    b
    • 3
    • 3
  • j

    jw

    11/18/2020, 2:58 AM
    @Manuel Lorenzo and you're using Turbine 0.2.0 or 0.2.1? Can you check the
    dependencies
    task and ensure the version of Kotlin that's being used in the test runtime classpath?
    m
    • 2
    • 1
  • c

    Cyril Find

    11/20/2020, 6:13 PM
    Hi, about Wire again, can I generate classes inside a package without the package name being prefixed in
    GrpcMethod
    's
    path
    ? (or am i doing something weird ? )
    • 1
    • 1
  • k

    kenkyee

    11/27/2020, 11:30 PM
    sqldelight doesn't have support for Paging Library 3 yet? Looks like this creates the older PositionalDataSource? QueryDataSourceFactory - SQLDelight - SQLDelight (cashapp.github.io) instead of the newer PagingSource<Int, datatype> that Paging Library 3 needs?
    n
    • 2
    • 2
  • p

    Paul Woitaschek

    11/30/2020, 10:12 AM
    Is there a reason, okio is missing watchOs? https://github.com/square/okio/blob/0613e03782cc8ffbe4f1ce0fd8ef21aae276ea04/okio/build.gradle#L26
    • 1
    • 1
  • c

    Cicero

    12/03/2020, 12:06 AM
    Hey so how to setup sqlDelight properly? I quadruple checked this repo and my file structure: https://github.com/kotlin-hands-on/kmm-networking-and-data-storage/tree/final This dudes post which is similar to my problem: https://kotlinlang.slack.com/archives/C3PQML5NU/p1602659275380200 And his “solution” here on this question : https://github.com/cashapp/sqldelight/issues/2050 Nothing really works, is there any gimmick that your eyes could sleep by?
    r
    • 2
    • 3
  • s

    savrov

    12/03/2020, 9:15 AM
    hi, can KotlinPoet be used with Kotlin Multiplatform?
    j
    g
    +4
    • 7
    • 10
  • b

    Brady Aiello

    12/03/2020, 5:34 PM
    A couple SQLDelight questions (1.4.4, Android): 1. After creating a
    CREATE VIEW
    statement, does it need to be declared as a method to be generated, and then invoked at runtime? 2. Is there any limitation to the number of `VIEW`'s or nested queries you can create?
    l
    • 2
    • 6
  • j

    jw

    12/04/2020, 11:02 PM
    That adds the dependency to the class path of your build scripts and then you have to apply the plugin. While we do support the plugins block, you have to tell Gradle to look in Maven central as we do not publish to Gradle's proprietary portal
    c
    • 2
    • 1
  • c

    Cicero

    12/04/2020, 11:26 PM
    Isn’t this exactly what I’m doing in this block?
    allprojects {
        repositories {
            google()
            mavenCentral()
            jcenter()
            maven(url = "<https://dl.bintray.com/ekito/koin>")
            maven(url = "<https://kotlin.bintray.com/kotlin-js-wrappers/>")
            maven(url = "<https://jitpack.io>")
        }
    }
    n
    • 2
    • 1
  • c

    Cicero

    12/04/2020, 11:40 PM
    This works https://github.com/kotlin-hands-on/kmm-networking-and-data-storage/tree/final so I’m stripping it for parts until mine work
    r
    • 2
    • 39
  • c

    Cicero

    12/05/2020, 1:18 AM
    Stupid solution:
    id("com.squareup.sqldelight") version "1.4.2"
    h
    • 2
    • 1
  • s

    simon.vergauwen

    12/10/2020, 12:38 PM
    I am attempting to use
    RETURNING
    for the Postgress Dialect with SqlDelight but it doesn't seem to be working. It was added in
    1.4.3
    according to the release notes, https://github.com/cashapp/sqldelight/releases/tag/1.4.3. Any idea if this is possible or I am doing something wrong? The
    SqlDriver#execute
    is fixed to
    Unit
    so it seems it cannot return any value. I am using it in a simple query like this.
    delete:
    DELETE FROM players
    WHERE id = ?
    RETURNING *;
    n
    • 2
    • 3
  • j

    jw

    12/12/2020, 8:42 PM
    The new KotlinPoet is much more aggressive about escaping
    j
    • 2
    • 1
  • j

    jessewilson

    12/15/2020, 5:22 AM
    We've made progress on our Kotlin multiplatform filesystem API. If you'd like to see if this will satisfy your multiplatform file I/O use cases, please do! https://github.com/square/okio/tree/master/okio-files/src/commonMain/kotlin/okio
    😍 2
    :kotlin-intensifies: 5
    👀 1
    ❤️ 18
    💥 2
    👍 10
    🎉 2
    :kotlin-flag: 2
    m
    l
    • 3
    • 5
  • d

    danieeh

    12/15/2020, 10:26 AM
    Hello! I hope you can help me 🙂 I’m trying to get through the migration process using Sqldelight with postgress dialect in a spring boot project.. to add some context: - I have my entity in a
    .sq
    file with its queries - I’ve added a
    1.sqm
    file adding a new column - this is the sqldelight configuration:
    sqldelight {
      database("EntertainmentDb") {
        packageName = "[..].entertainment.db"
        sourceFolders = listOf("sqldelight")
        deriveSchemaFromMigrations = true
        schemaOutputDirectory = file("src/main/sqldelight/db/")
        migrationOutputDirectory = file("$buildDir/resources/main/migrations")
        migrationOutputFileFormat = ".sql"
        dialect = "postgresql"
      }
    }
    but when executing the interface task I get all these errors.. thanks in advance!
    Untitled
    n
    • 2
    • 5
  • p

    Paul Woitaschek

    12/15/2020, 11:12 AM
    Is there a permanent place for okio snapshots? I referenced
    com.squareup.okio:okio-multiplatform:2.10.0-20201202.152951-29
    but now our ci starts failing because that snapshot got removed. I need to use the snapshot because I’m targeting watchosArm32 which is not present in 2.9 and I want reproducible builds
    m
    j
    r
    • 4
    • 21
  • j

    jw

    12/15/2020, 4:06 PM
    The postgres support is probably the least supported of the big three. You probably need to file a bug on sql-psi for support of this specific syntax.
    d
    • 2
    • 1
  • m

    myanmarking

    12/16/2020, 12:15 AM
    i’m having trouble with a query that contains ‘group_concat’. The column may be null, yet the generated field is non-null
    d
    • 2
    • 4
  • p

    Paul Woitaschek

    12/17/2020, 9:57 AM
    The okio multiplatform builds are broken: This one https://oss.sonatype.org/content/repositories/snapshots/com/squareup/okio/okio-multip[…]SNAPSHOT/okio-multiplatform-2.10.0-20201207.161607-33.module correctly declares ios and watchos publications but this one doesn’t at all: https://oss.sonatype.org/content/repositories/snapshots/com/squareup/okio/okio-multip[…]SNAPSHOT/okio-multiplatform-2.10.0-20201216.125117-43.module
    j
    m
    r
    • 4
    • 27
  • r

    russhwolf

    12/20/2020, 9:22 PM
    Two questions on okio-files: 1. Is there an equivalent to
    <http://java.io|java.io>.File.exists()
    that I’m missing? ditto for
    mkdirs()
    since
    Filesystem.createDirectory(path)
    doesn’t appear to create parent directories 2. Is there any plan to promote the
    use()
    extensions on Sink and Source to public API?
    👍 3
    j
    • 2
    • 2
  • n

    Nikky

    12/21/2020, 10:50 AM
    without having looked at okio files in detail.. can it do symlinks and hardlinks ?
    🇳🇴 1
    j
    • 2
    • 1
  • j

    jw

    12/25/2020, 6:52 PM
    From what? A BufferedSource/Buffer? It's not meant for random access so reading will consume. You use a peeked reader by calling peek() and then skip(offset).
    l
    j
    • 3
    • 9
  • b

    basher

    12/28/2020, 12:01 AM
    I have this .sq, which looks like it should compile to me.
    CREATE TABLE SchemaVersion (
        id INT PRIMARY KEY NOT NULL,
        version INT NOT NULL
    );
    
    setVersion:
    INSERT INTO SchemaVersion(id, version) VALUES (0, ?)
    ON CONFLICT (id) DO UPDATE SET version = excluded.version;
    Instead, I get
    line 8:0 - ',' or RETURNING expected, got 'ON'
    7    INSERT INTO SchemaVersion(id, version) VALUES (0, 'test')
    8    ON CONFLICT (id) DO UPDATE SET version = excluded.version
    j
    • 2
    • 5
  • l

    Lilly

    01/12/2021, 8:52 PM
    Hi, I'm using Okio. I have a Buffer with 2793 bytes which is 21 * 133 bytes. I would like to iterate over the buffer in chunks of size 133 so that I can iterate over it 21 times. How would I achieve this?
    z
    j
    • 3
    • 10
  • j

    jessewilson

    01/22/2021, 11:25 AM
    If you wanna include a comment that might include a % character, use %L and pass the comment string as a parameter
    d
    • 2
    • 1
  • j

    jw

    01/23/2021, 4:37 PM
    Got an executable example that demonstrates the behavior?
    👍 1
    j
    • 2
    • 2
  • n

    Nicholas Doglio

    02/07/2021, 10:49 PM
    Just started playing around with Workflow so maybe I’m missing something but how do I have an action that can start an activity or interact with an Android
    Context
    ? I have a
    LoginWorkflow
    that can launch a Oauth flow that redirects to the browser and I’m not quite sure how to do that 🤔
    r
    m
    • 3
    • 6
Powered by Linen
Title
n

Nicholas Doglio

02/07/2021, 10:49 PM
Just started playing around with Workflow so maybe I’m missing something but how do I have an action that can start an activity or interact with an Android
Context
? I have a
LoginWorkflow
that can launch a Oauth flow that redirects to the browser and I’m not quite sure how to do that 🤔
r

Ray Ryan

02/08/2021, 4:47 AM
You could make the activity available as part of the props of the root workflow. Or go the other direction, have the workflow emit output events that signal code in the activity when some external chore is needed. I guess I'd lean toward the former, so that I could state machine the hell out of oauth
n

Nicholas Doglio

02/08/2021, 8:33 PM
My initial idea was to do something like the latter but I think the former makes a lot more sense! Thanks @Ray Ryan 👍
r

Ray Ryan

02/08/2021, 8:36 PM
NP, and please let us know how it goes, here or in http://workflow-community.slack.com
LMK if you want an invite to the latter
n

Nicholas Doglio

02/08/2021, 8:47 PM
Yeah would appreciate an invite
m

Monish Syed

07/15/2021, 11:40 AM
Hello @Ray Ryan 👋 Could i get an invite as well? Thanks
View count: 9