Re: [racket-users] Add fns or at least sample code for getting column names from table?

2016-12-29 Thread 'John Clements' via Racket Users
> On Dec 28, 2016, at 12:51, David Storrs wrote: > > There's also this: > > (query-rows db >" >SELECT column_name > FROM information_schema.columns > WHERE table_schema = 'your_schema' > AND

Re: [racket-users] Add fns or at least sample code for getting column names from table?

2016-12-28 Thread David Storrs
There's also this: (query-rows db " SELECT column_name FROM information_schema.columns WHERE table_schema = 'your_schema' AND table_name = 'your_table' ") On Wed, Dec 28, 2016 at 12:46 PM, Philip McGrath

Re: [racket-users] Add fns or at least sample code for getting column names from table?

2016-12-28 Thread Philip McGrath
Something like this would be really good. I also, relatively recently, discovered the "name" fields when I happened to look at a rows-result directly, and being able to work with columns by name rather than by position is much better. I guess I should have realized there was some way of doing

[racket-users] Add fns or at least sample code for getting column names from table?

2016-12-28 Thread 'John Clements' via Racket Users
For the last few years, I’ve believed that there was no way to get the column names of tables using the db interface. Today I discovered that—using both postgresql and sqlite3, at least—I can extract these from the “name” fields of the “headers” field of the row-response to a “SELECT * FROM