What would be the eqivalent of show tables from MySQL in Kotlin ExposedHow to find all the tables in MySQL with specific column names in them?What is the best collation to use for MySQL with PHP?Duplicating a MySQL table, indices, and dataHow to import CSV file to MySQL tableInsert into a MySQL table or update if existsUpdate one MySQL table with values from anotherHow to get the sizes of the tables of a MySQL database?What is the equivalent of Java static methods in Kotlin?Kotlin - Exposed DAO: Parameter specified as non-null is null [..] (parameter id)How to create an index on foreign keys with kotlin exposed on a PostgreSQL database

Can't remember the name of this game

Employer asking for online access to bank account - Is this a scam?

Why do airplanes use an axial flow jet engine instead of a more compact centrifugal jet engine?

Integrating an absolute function using Mathematica

Employer demanding to see degree after poor code review

Does this degree 12 genus 1 curve have only one point over infinitely many finite fields?

How can people dance around bonfires on Lag Lo'Omer - it's darchei emori?

Command to Search for Filenames Exceeding 143 Characters?

How bitcoin nodes update UTXO set when their latests blocks are replaced?

What are the benefits of cryosleep?

Would the Geas spell work in a dead magic zone once you enter it?

What are these arcade games in Ghostbusters 1984?

Why are C64 games inconsistent with which joystick port they use?

How do I align equations in three columns, justified right, center and left?

When do characters level up?

Where did Wilson state that the US would have to force access to markets with violence?

Apparent Ring of Craters on the Moon

How strong are Wi-Fi signals?

Under what law can the U.S. arrest International Criminal Court (ICC) judges over war crimes probe?

Rests in pickup measure (anacrusis)

Mother abusing my finances

How to convert to standalone document a matrix table

Riley Rebuses that Share a Common Theme

Placing bypass capacitors after VCC reaches the IC



What would be the eqivalent of show tables from MySQL in Kotlin Exposed


How to find all the tables in MySQL with specific column names in them?What is the best collation to use for MySQL with PHP?Duplicating a MySQL table, indices, and dataHow to import CSV file to MySQL tableInsert into a MySQL table or update if existsUpdate one MySQL table with values from anotherHow to get the sizes of the tables of a MySQL database?What is the equivalent of Java static methods in Kotlin?Kotlin - Exposed DAO: Parameter specified as non-null is null [..] (parameter id)How to create an index on foreign keys with kotlin exposed on a PostgreSQL database






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Trying out Kotlin Exposed for the first time. I have been able to learn Kotlin to a reasonable extent now and now I'm trying to learn Kotlin Exposed API for database access. But I'm unable to find an equivalent for SHOW tables; of MySQL.



It would be nice to be able to list out tables without previously hard coding them into the program.



Is there an equivalent to that query in Exposed? if so how? Thanks in advance










share|improve this question






















  • if I may ask, why do you want to list the db tables from within the code?

    – euniceadu
    Mar 24 at 9:14











  • I want to write extensible code that would automatically create pages for each individual table, and a navbar with the list of tables. so when the application loads I want to populate the list of tables dynamically from the database. the database will change anytime and tables may get added in the future

    – Deepan
    Mar 24 at 10:52


















0















Trying out Kotlin Exposed for the first time. I have been able to learn Kotlin to a reasonable extent now and now I'm trying to learn Kotlin Exposed API for database access. But I'm unable to find an equivalent for SHOW tables; of MySQL.



It would be nice to be able to list out tables without previously hard coding them into the program.



Is there an equivalent to that query in Exposed? if so how? Thanks in advance










share|improve this question






















  • if I may ask, why do you want to list the db tables from within the code?

    – euniceadu
    Mar 24 at 9:14











  • I want to write extensible code that would automatically create pages for each individual table, and a navbar with the list of tables. so when the application loads I want to populate the list of tables dynamically from the database. the database will change anytime and tables may get added in the future

    – Deepan
    Mar 24 at 10:52














0












0








0








Trying out Kotlin Exposed for the first time. I have been able to learn Kotlin to a reasonable extent now and now I'm trying to learn Kotlin Exposed API for database access. But I'm unable to find an equivalent for SHOW tables; of MySQL.



It would be nice to be able to list out tables without previously hard coding them into the program.



Is there an equivalent to that query in Exposed? if so how? Thanks in advance










share|improve this question














Trying out Kotlin Exposed for the first time. I have been able to learn Kotlin to a reasonable extent now and now I'm trying to learn Kotlin Exposed API for database access. But I'm unable to find an equivalent for SHOW tables; of MySQL.



It would be nice to be able to list out tables without previously hard coding them into the program.



Is there an equivalent to that query in Exposed? if so how? Thanks in advance







mysql kotlin kotlin-exposed






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 7:23









DeepanDeepan

478




478












  • if I may ask, why do you want to list the db tables from within the code?

    – euniceadu
    Mar 24 at 9:14











  • I want to write extensible code that would automatically create pages for each individual table, and a navbar with the list of tables. so when the application loads I want to populate the list of tables dynamically from the database. the database will change anytime and tables may get added in the future

    – Deepan
    Mar 24 at 10:52


















  • if I may ask, why do you want to list the db tables from within the code?

    – euniceadu
    Mar 24 at 9:14











  • I want to write extensible code that would automatically create pages for each individual table, and a navbar with the list of tables. so when the application loads I want to populate the list of tables dynamically from the database. the database will change anytime and tables may get added in the future

    – Deepan
    Mar 24 at 10:52

















if I may ask, why do you want to list the db tables from within the code?

– euniceadu
Mar 24 at 9:14





if I may ask, why do you want to list the db tables from within the code?

– euniceadu
Mar 24 at 9:14













I want to write extensible code that would automatically create pages for each individual table, and a navbar with the list of tables. so when the application loads I want to populate the list of tables dynamically from the database. the database will change anytime and tables may get added in the future

– Deepan
Mar 24 at 10:52






I want to write extensible code that would automatically create pages for each individual table, and a navbar with the list of tables. so when the application loads I want to populate the list of tables dynamically from the database. the database will change anytime and tables may get added in the future

– Deepan
Mar 24 at 10:52













2 Answers
2






active

oldest

votes


















2














There is VendorDialect.allTableNames() function in Exposed which uses jdbc DatabaseMetadata to fetch tables.



Database.connect() // your connection string

transaction
val tableNames = TransactionManager.current().db.dialect.allTableNames()






share|improve this answer
































    1














    From what I've seen in the documentation and the source code so far, the fetchAllTables method in the SchemaUtils class is private so your best option will be to execute a MySQL query. The code below does what you want:



    val connect = Database.Companion.connect(dataSource())

    val tableNames = mutableListOf<String>()

    transaction
    val conn = TransactionManager.current().connection
    val statement = conn.createStatement()
    val query = "show tables"
    statement.execute(query)
    val results = statement.resultSet
    while (results.next())
    tableNames.add(results.getString(1))



    tableNames.forEach
    println(it)






    share|improve this answer























    • I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

      – Deepan
      Mar 24 at 12:04











    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321578%2fwhat-would-be-the-eqivalent-of-show-tables-from-mysql-in-kotlin-exposed%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    There is VendorDialect.allTableNames() function in Exposed which uses jdbc DatabaseMetadata to fetch tables.



    Database.connect() // your connection string

    transaction
    val tableNames = TransactionManager.current().db.dialect.allTableNames()






    share|improve this answer





























      2














      There is VendorDialect.allTableNames() function in Exposed which uses jdbc DatabaseMetadata to fetch tables.



      Database.connect() // your connection string

      transaction
      val tableNames = TransactionManager.current().db.dialect.allTableNames()






      share|improve this answer



























        2












        2








        2







        There is VendorDialect.allTableNames() function in Exposed which uses jdbc DatabaseMetadata to fetch tables.



        Database.connect() // your connection string

        transaction
        val tableNames = TransactionManager.current().db.dialect.allTableNames()






        share|improve this answer















        There is VendorDialect.allTableNames() function in Exposed which uses jdbc DatabaseMetadata to fetch tables.



        Database.connect() // your connection string

        transaction
        val tableNames = TransactionManager.current().db.dialect.allTableNames()







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 25 at 19:01

























        answered Mar 24 at 16:18









        TapacTapac

        24616




        24616























            1














            From what I've seen in the documentation and the source code so far, the fetchAllTables method in the SchemaUtils class is private so your best option will be to execute a MySQL query. The code below does what you want:



            val connect = Database.Companion.connect(dataSource())

            val tableNames = mutableListOf<String>()

            transaction
            val conn = TransactionManager.current().connection
            val statement = conn.createStatement()
            val query = "show tables"
            statement.execute(query)
            val results = statement.resultSet
            while (results.next())
            tableNames.add(results.getString(1))



            tableNames.forEach
            println(it)






            share|improve this answer























            • I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

              – Deepan
              Mar 24 at 12:04















            1














            From what I've seen in the documentation and the source code so far, the fetchAllTables method in the SchemaUtils class is private so your best option will be to execute a MySQL query. The code below does what you want:



            val connect = Database.Companion.connect(dataSource())

            val tableNames = mutableListOf<String>()

            transaction
            val conn = TransactionManager.current().connection
            val statement = conn.createStatement()
            val query = "show tables"
            statement.execute(query)
            val results = statement.resultSet
            while (results.next())
            tableNames.add(results.getString(1))



            tableNames.forEach
            println(it)






            share|improve this answer























            • I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

              – Deepan
              Mar 24 at 12:04













            1












            1








            1







            From what I've seen in the documentation and the source code so far, the fetchAllTables method in the SchemaUtils class is private so your best option will be to execute a MySQL query. The code below does what you want:



            val connect = Database.Companion.connect(dataSource())

            val tableNames = mutableListOf<String>()

            transaction
            val conn = TransactionManager.current().connection
            val statement = conn.createStatement()
            val query = "show tables"
            statement.execute(query)
            val results = statement.resultSet
            while (results.next())
            tableNames.add(results.getString(1))



            tableNames.forEach
            println(it)






            share|improve this answer













            From what I've seen in the documentation and the source code so far, the fetchAllTables method in the SchemaUtils class is private so your best option will be to execute a MySQL query. The code below does what you want:



            val connect = Database.Companion.connect(dataSource())

            val tableNames = mutableListOf<String>()

            transaction
            val conn = TransactionManager.current().connection
            val statement = conn.createStatement()
            val query = "show tables"
            statement.execute(query)
            val results = statement.resultSet
            while (results.next())
            tableNames.add(results.getString(1))



            tableNames.forEach
            println(it)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 24 at 11:25









            euniceadueuniceadu

            6831531




            6831531












            • I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

              – Deepan
              Mar 24 at 12:04

















            • I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

              – Deepan
              Mar 24 at 12:04
















            I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

            – Deepan
            Mar 24 at 12:04





            I understand. I just have to use the normal piece of code instead of Exposed. I hope there's a way to do this in exposed. because I might want to construct the DAO dynamically too using describe;

            – Deepan
            Mar 24 at 12:04

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321578%2fwhat-would-be-the-eqivalent-of-show-tables-from-mysql-in-kotlin-exposed%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript