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

org.jetbrains.kotlinx.dataframe.io.Jdbc.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.kotlinx.dataframe.AnyFrame
import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.codeGen.AbstractDefaultReadMethod
import org.jetbrains.kotlinx.dataframe.codeGen.DefaultReadDfMethod
import org.jetbrains.kotlinx.jupyter.api.Code
import java.io.File
import java.io.InputStream

// TODO: https://github.com/Kotlin/dataframe/issues/450
public class Jdbc :
    SupportedCodeGenerationFormat,
    SupportedDataFrameFormat {
    public override fun readDataFrame(stream: InputStream, header: List): AnyFrame = DataFrame.readJDBC(stream)

    public override fun readDataFrame(file: File, header: List): AnyFrame = DataFrame.readJDBC(file)

    override fun readCodeForGeneration(
        stream: InputStream,
        name: String,
        generateHelperCompanionObject: Boolean,
    ): Code {
        TODO("Not yet implemented")
    }

    override fun readCodeForGeneration(file: File, name: String, generateHelperCompanionObject: Boolean): Code {
        TODO("Not yet implemented")
    }

    override fun acceptsExtension(ext: String): Boolean = ext == "jdbc"

    override fun acceptsSample(sample: SupportedFormatSample): Boolean = true // Extension is enough

    override val testOrder: Int = 40000

    override fun createDefaultReadMethod(pathRepresentation: String?): DefaultReadDfMethod =
        DefaultReadJdbcMethod(pathRepresentation)
}

private fun DataFrame.Companion.readJDBC(stream: File): DataFrame<*> {
    TODO("Not yet implemented")
}

private fun DataFrame.Companion.readJDBC(stream: InputStream): DataFrame<*> {
    TODO("Not yet implemented")
}

internal class DefaultReadJdbcMethod(path: String?) : AbstractDefaultReadMethod(path, MethodArguments.EMPTY, READ_JDBC)

private const val READ_JDBC = "readJDBC"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy