All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.dataframe.io.jdbcSchema.kt Maven / Gradle / Ivy

There is a newer version: 0.15.0-dev-5023
Show newest version
package org.jetbrains.kotlinx.dataframe.io

import org.jetbrains.dataframe.impl.codeGen.CodeGenerator
import org.jetbrains.kotlinx.dataframe.annotations.DataSchema
import org.jetbrains.kotlinx.dataframe.impl.codeGen.CodeGenerationReadResult
import org.jetbrains.kotlinx.jupyter.api.Code
import java.net.URL

// TODO: helper functions created to support existing hierarchy https://github.com/Kotlin/dataframe/issues/450
public val CodeGenerator.Companion.databaseCodeGenReader: (url: URL, name: String) -> CodeGenerationReadResult
    get() = { url, name ->
        try {
            val code = buildCodeForDB(url, name)
            throw RuntimeException()
            CodeGenerationReadResult.Success(code, Jdbc())
        } catch (e: Throwable) {
            CodeGenerationReadResult.Error(e)
        }
    }

public fun buildCodeForDB(url: URL, name: String): Code {
    val annotationName = DataSchema::class.simpleName
    val visibility = "public "
    val propertyVisibility = "public "

    val declarations = mutableListOf()
    return declarations.joinToString()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy