Coder Social home page Coder Social logo

ctripcorp / sqllin Goto Github PK

View Code? Open in Web Editor NEW
215.0 3.0 10.0 6.02 MB

A DSL ORM library for Kotlin Multiplatform.

License: Apache License 2.0

Kotlin 29.81% Shell 0.19% C 70.00%
android ios kotlin sqlite kotlin-jvm kotlin-multiplaform kotlin-multiplatform-library kotlin-native-library macos

sqllin's Introduction

SQLlin

中文版请见这里

SQLlin is a Kotlin Multiplatform SQLite library that based on DSL and KSP. You can write SQL statements with your Kotlin code and these can be verified by Kotlin compiler. Sample just like be this:

private val db by lazy { Database(name = "person.db", path = path, version = 1) }

fun sample() {
    val tom = Person(age = 4, name = "Tom")
    val jerry = Person(age = 3, name = "Jerry")
    val jack = Person(age = 8, name = "Jack")
    val selectStatement: SelectStatement<Person> = db {
        PersonTable { table ->
            table INSERT listOf(tom, jerry, jack)
            table UPDATE SET { age = 5; name = "Tom" } WHERE ((age LTE 5) AND (name NEQ "Tom"))
            table DELETE WHERE ((age GTE 10) OR (name NEQ "Jerry"))
            table SELECT WHERE (age LTE 5) GROUP_BY age HAVING (upper(name) EQ "TOM") ORDER_BY (age to DESC) LIMIT 2 OFFSET 1
        }
    }
    selectStatement.getResult().forEach { person ->
        println(person.name)
    }
}

SQLlin is able to insert Kotlin objects into database directly, and could query Kotlin objects directly from database. The serialization and deserialization ability based on kotlinx.serialization.

SQLlin supports these platforms:

  • Multiplatform Common
  • Android (6.0+)
  • JVM (Java 11+, since 1.2.0)
  • iOS (x64, arm64, simulatorArm64)
  • macOS (x64, arm64)
  • watchOS (x64, arm32, arm64, simulatorArm64, deviceArm64)
  • tvOS (x64, arm64, simulatorArm64)
  • Linux (x64, arm64)
  • Windows (mingwX64)

The architecture design of SQLlin is shown in the figure:

sqllin-architecture

SQLlin has two major parts: sqllin-dsl and sqllin-driver. The sqllin-driver is a common multiplatform SQLite low-level API, most of the time it is not recommended to use it directly. The sqllin-dsl is the SQL statements DSL implementation and based on sqllin-driver.

The sqllin-processor uses KSP to process annotations and generate code for use with sqllin-dsl.

You can learn how to use sqllin-dsl in these documentations:

I don't recommend use sqllin-driver directly, but if you want to learn more about it, you can read:

R8/ProGuard

Due to sqllin-dsl's deserialization based on kotlinx.serialization, R8/ProGuard configuration please refer to kotlinx.serialization#Android.

License

Distributed under the Apache License, Version 2.0.

See LICENSE for more information.

sqllin's People

Contributors

nbransby avatar qdsfdhvh avatar qiaoyuang avatar sasaju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sqllin's Issues

下载依赖报错

build.gradle.kts加入教程中的依赖后,执行gradle -i报错

Plugin [id: 'org.jetbrains.kotlin.multiplatform'] was not found in any of the following sources:

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

配置

plugins {
    id("java")
    id("org.jetbrains.kotlin.jvm") version "1.8.0"
    id("org.jetbrains.intellij") version "1.13.0"

    kotlin("multiplatform")
    kotlin("plugin.serialization")
    id("com.android.library")
    id("com.google.devtools.ksp")
}

repositories {
    mavenCentral()
    google()
    maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
    maven {
        url = uri("https://plugins.gradle.org/m2/")
    }
}

Sorry, Suspending maintaining for a few months

As the only one maintainer, I have to say: I'm sorry. In recent a few months, I would have been being so busy in my job and my personal things. Now, I don't have enough time to deal with issues and pull requests, I decided to suspend maintaining a few months. I will come back in March or April, so, if you have any question, you can still submit issues, I will handle them when I come back. Thanks.

org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'kspMainMetadata' not found.

plugins {
kotlin("jvm")
id("org.jetbrains.compose")
kotlin("plugin.serialization") version "1.5.0"
id("com.google.devtools.ksp") version "1.8.10-1.0.9" apply false
}

repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}

val sqllinVersion = "1.2.3"

dependencies {
// Note, if you develop a library, you should use compose.desktop.common.
// compose.desktop.currentOs should be used in launcher-sourceSet
// (in a separate module for demo project and in testMain).
// With compose.desktop.common you will also lose @Preview functionality
implementation(compose.desktop.currentOs)
implementation("com.ctrip.kotlin:sqllin-dsl:$sqllinVersion")
// sqllin-driver
implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion")

// The sqllin-dsl serialization and deserialization depends on kotlinx-serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")

// // Since 1.2.2, sqllin-dsl depends on kotlinx.coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")

add("kspMainMetadata", "com.ctrip.kotlin:sqllin-processor:$sqllinVersion")

}

较为复杂点的查询语句

碰到个问题,请教下:
我在jetpack room数据库这边写的sql语句如下:

    @Query(
        "select * from video_history where favorite = 1 " +
                "and (case when :type >= 0 then data_type = :type else data_type >= 0 end) " +
                "ORDER BY (case when last_time > create_time then last_time else create_time end) DESC " +
                "limit :pageSize"
    )
    fun getFavoriteVideoList(pageSize: Int = 20, type: Int = -1): Flow<List<PlayHistoryBean>>

order by这里,需要根据两个字段来进行排序,优先last_time,如果last_time小于create_time,就按照create_time排序,如果我想用SQLlin实现,目前是不是无法直接实现?
如果能实现的话,我应该怎么写?
如果目前无法实现的话,那是否有其它写法可以做到?

Update Kotlin version: 1.9.20 -> 1.9.21

Dear Library Maintainer,

We have just released Kotlin 1.9.21 that fixes critical issue that, in some cases, resulted in the production of incorrect klib libraries. Details: https://youtrack.jetbrains.com/issue/KT-62515. We have detected that there are libraries built with 1.9.20 that were published to Maven Central. And these libraries are affected by the issue:

com.ctrip.kotlin:sqllin-driver:1.2.2
com.ctrip.kotlin:sqllin-dsl:1.2.2

We highly recommend you rebuilding these libraries with 1.9.21 and republishing them to minimize possible negative impact. Please take our apologies for this inconvenience. We will take the necessary measures to avoid similar issues in the future.

Kotlin Team.

Could not find org.jetbrains.kotlinx-atomicfu-0.17.3-nativeInterop-8G5yng.klib

你好,试用了下sqllin非常棒👍🏻 ,但也遇到以下问题难以解决:

在启用了 id("org.jetbrains.compose") 插件的模块,如果增加 compose.foundation 依赖,构建时就会失败

环境:
JDK 11
kotlin 1.8.20
ksp 1.8.20-1.0.11
gradle 7.5
agp 7.4.2
compose 1.4.0

gradle配置:

plugins {
    kotlin("multiplatform")
    id("com.android.library")
    id("org.jetbrains.compose")
    id("com.google.devtools.ksp")
}
kotlin {
    ...
    sourceSets {
            val commonMain by getting {
                kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
                dependencies {
                    implementation(compose.runtime)
                    implementation(compose.foundation) // 这个去掉则正常
                }
            }
    }
}
dependencies {
    add("kspCommonMainMetadata", project(":sqllin-processor"))
    ...
}
afterEvaluate {
// 如果去掉下面的配置并在dependencies里增加kspXXX,也能正常build,但ksp就不会再在commonMain里生成代码而是在对应的target里
    tasks {
        withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
            if (name != "kspCommonMainKotlinMetadata") {
                dependsOn("kspCommonMainKotlinMetadata")
            }
        }
    }
}

错误堆栈:

> Task :xxxModule:kspCommonMainKotlinMetadata FAILED

java.lang.IllegalStateException: e: Could not find "/Users/xxx/Documents/xxxProject/xxxModule/build/kotlinTransformedMetadataLibraries/commonMain/org.jetbrains.kotlinx-atomicfu-0.17.3-nativeInterop-8G5yng.klib" in [/Users/xxx/Library/Application Support/kotlin/daemon]
	at org.jetbrains.kotlin.library.SingleFileResolveKt$resolveSingleFileKlib$1.fatal(SingleFileResolve.kt:21)
	at org.jetbrains.kotlin.library.KotlinLibrarySearchPathResolver.resolve(SearchPathResolver.kt:171)
	at org.jetbrains.kotlin.library.KotlinLibrarySearchPathResolver.resolve(SearchPathResolver.kt:176)
	at org.jetbrains.kotlin.library.CompilerSingleFileKlibResolveStrategy.resolve(SearchPathResolver.kt:298)
	at org.jetbrains.kotlin.library.SingleFileResolveKt.resolveSingleFileKlib(SingleFileResolve.kt:24)
	at org.jetbrains.kotlin.library.SingleFileResolveKt.resolveSingleFileKlib$default(SingleFileResolve.kt:15)
	at org.jetbrains.kotlin.cli.metadata.KlibMetadataDependencyContainer.<init>(K2MetadataKlibSerializer.kt:117)
	at org.jetbrains.kotlin.cli.metadata.K2MetadataKlibSerializer$serialize$analyzer$1.invoke(K2MetadataKlibSerializer.kt:49)
	at org.jetbrains.kotlin.cli.metadata.K2MetadataKlibSerializer$serialize$analyzer$1.invoke(K2MetadataKlibSerializer.kt:43)
	at org.jetbrains.kotlin.cli.metadata.CommonAnalysisKt.runCommonAnalysisForSerialization(CommonAnalysis.kt:42)
	at org.jetbrains.kotlin.cli.metadata.K2MetadataKlibSerializer.serialize(K2MetadataKlibSerializer.kt:48)
	at org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler.doExecute(K2MetadataCompiler.kt:122)
	at org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler.doExecute(K2MetadataCompiler.kt:40)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:100)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:46)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1486)
	at jdk.internal.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

How to nore the columns in model

example:

@DBRow(tableName = "memo")
@Serializable
data class Memo(
    val id: Long,
    val createdTs: Long,
    val creatorId: Long,
    var content: String,
   @DbIgnore //ignore the colume
    val resourceList: MutableList<Resource> = mutableListOf()
)

自增主键ID问题

您好!
我想问一下,如果我创建的表中包含自增键(比如说字段名叫 id),那么我对应表的实体类需要应该怎么来创建?如果实体类加入了 id 这个属性,那么在执行insert的时候就会出问题,如果实体类不加入 id 这个属性,那么我在select的时候应该怎么来取得这个 id 的值呢

在桌面平台上没有找到数据库

image
桌面平台上,使用以上创建数据库 ,然后在尝试读取表的时候,报错
Exception in thread "AWT-EventQueue-0" org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: InfoPage)

请问,我是需要采用这个方式手动创建数据库吗?
image

Supported Multiplatform unit tests

Now, SQLlin just supports macOS X64 unit tests and Android instrumentation tests. Next step, I will make the MinGW X64 and Linux X64 unit tests available. When I finished that, I will research if run other Apple(iOS, watchOS, tvOS) unit tests on simulator is available.

Unable to link under Linux

Hello
I am trying to use SQLlin in Kotlin/Native Linux x64 platform.
Unfortunately it breaks with an error:


The /home/teras/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold command returned non-zero exit code: 1.
output:
/home/teras/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold: error: cannot find -lsqlite3
/tmp/konan_temp4860865497063593644/result.o:out:function com_ctrip_sqllin_sqlite3_sqlite3_close_v2_wrapper7: error: undefined reference to 'sqlite3_close_v2'
/tmp/konan_temp4860865497063593644/result.o:out:function com_ctrip_sqllin_sqlite3_sqlite3_exec_wrapper8: error: undefined reference to 'sqlite3_exec'
...

plus a huge list of unresolved references to sqlite functions.

Of course, I do have sqlite installed

$ ls -l /usr/lib/libsqlite3.so 
lrwxrwxrwx root root 19 B Mon Sep 11 20:45:28 2023  /usr/lib/libsqlite3.so ⇒ libsqlite3.so.0.8.6

so the problem must be something else.
Any idea?

如何配置postgresql?

您好,我看文档中是本地数据库的配置方法,如何配置postgresql数据库呢?

在一些库更新了版本后,目前ios无法运行了

不清楚是什么原因导致的,安卓和jvm没问题。
org.jetbrains.compose 1.6.0
这个应该是一个较大的变化,也许是这里的问题?

ld: Undefined symbols:
  _sqlite3_bind_blob, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_bind_blob_wrapper69 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_bind_double, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_bind_double_wrapper71 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_bind_int64, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_bind_int64_wrapper73 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_bind_null, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_bind_null_wrapper74 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_bind_text, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_bind_text_wrapper75 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_bind_zeroblob, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_bind_zeroblob_wrapper80 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_busy_timeout, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_busy_timeout_wrapper22 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_changes, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_changes_wrapper16 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_clear_bindings, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_clear_bindings_wrapper85 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_close_v2, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_close_v2_wrapper7 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_blob, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_blob_wrapper99 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_bytes, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_bytes_wrapper106 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_count, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_count_wrapper86 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_double, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_double_wrapper100 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_int64, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_int64_wrapper102 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_name, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_name_wrapper87 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_text, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_text_wrapper103 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_column_type, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_column_type_wrapper108 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_db_config, referenced from:
      knifunptr_com_ctrip_sqllin_sqlite314_sqlite3_db_config in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_db_readonly, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_db_readonly_wrapper177 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_errmsg, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_errmsg_wrapper53 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_exec, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_exec_wrapper8 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_finalize, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_finalize_wrapper109 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_last_insert_rowid, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_last_insert_rowid_wrapper14 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_open_v2, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_open_v2_wrapper43 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_prepare16_v2, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_prepare16_v2_wrapper61 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_reset, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_reset_wrapper110 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
  _sqlite3_step, referenced from:
      _com_ctrip_sqllin_sqlite3_sqlite3_step_wrapper97 in composeApp[47](libcom.ctrip.kotlin:sqllin-driver-cinterop-sqlite3-cache.a.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

warning: Run script build phase 'Compile Kotlin Framework' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'iosApp' from project 'iosApp')
** BUILD FAILED **

要存入或要查询的字符串中包含 ' 符号会报错 unrecognized token,这个要怎么解决

比如我要写入的一个字符串到指定字段,或者说更新某一个字段的内容,内容如下:

希望的力量~字符串'23~

似乎是因为字符串中包含英文的单引号,上面的内容中只有一个单引号。

写入方式通过直接传递实体类的方式:

        database {
            InfoPageDataTable { table ->
                table INSERT infoData
            }
        }

会报错,其它写入方式我未尝试,因为不会。

不仅写入会报错,查询时,上述内容也会报错。

SQL这方面我不太熟,还请大佬指点一下。

Long在ksp阶段有问题,生成的代码无法通过编译

image

以下是实体类本身

@DBRow("domain_record")
@Serializable
data class DomainRecord(
    val name: String,
    /**
     * @see model.protocol.RecordType
     */
    val recordType: Int,
    val content: String,
    val ttl: Int = 86400,
    val priority: Int = 10,
    val updateTime: Long = Clock.System.now().toEpochMilliseconds(),
    val cachedDomain: Boolean = false
) {
    val id = uuid4().toString()

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.