|
From: | Blake McBride |
Subject: | Re: [Bug-apl] List columns function in SQL library |
Date: | Thu, 24 Jul 2014 07:24:38 -0500 |
I've added a function number 9 to the SQL library. This function takes the name of a table and returns information about the columns in that table. The function has no name in SQL.apl yet, because I am currently overseas and my laptop has no Postgres, which means that it only works for SQLite so far.I'm sending this email because I have two questions for you guys:What should the function be called? SQL∆ColumnInfo, SQL∆Cols? Something better?The second issue I have is how to present the information. Currently, I'm simply returning a two-column matrix where column 1 contains the name and column 2 is a string that describes the type. SQLite at least returns some extra information, such as the uniqueness of the column, or non-nullability.Right now, the output looks like this:8⎕CR db SQL[9] 'bar'┌→──────────────────────────┐↓┌→─┐ ┌→──┐ │││id│ │int│ ││└──┘ └───┘ ││┌→───┐ ┌→───────────┐│││name│ │varchar(200)│││└────┘ └────────────┘││┌→────┐ ┌→──┐ │││value│ │int│ ││└─────┘ └───┘ ││┌→─────────┐ ┌→──────┐ │││extra_data│ │varchar│ ││└──────────┘ └───────┘ │└∊──────────────────────────┘Regards,Elias
[Prev in Thread] | Current Thread | [Next in Thread] |