{"repo":"neondatabase/psql-describe","free":true,"listed":false,"github":"https://github.com/neondatabase/psql-describe","clone":"git clone https://github.com/neondatabase/psql-describe.git","description":"psql's \\d (describe) family of commands ported to JavaScript","language":"JavaScript","stars":38,"topics":["describe","postgresql","psql"],"license":null,"category":"databases-storage","readme_excerpt":"psql-describe psql's \\d (describe) family of commands ported to JavaScript. From Postgres REL 18 0 , we take exec command d , exec command list and exec command sf sv from command.c , and all of describe.c and sql help.c , from src/bin/psql (note that sql help.c is generated during compilation of psql: to get hold of it, you first need to run ./configure in the Postgres repo root followed by make in src/bin/psql ). We use plenty of RegExp search-and-replace to turn this C code into valid JS syntax. We implement some C library functions, such as strlen and strchr , and some Postgres support functions, such as printTable and printQuery , in JavaScript. We write tests to catch problems, mostly related to pointer arithmetic, pointer dereferencing, and pointer output parameters. Then we fix them. This approach means that some of the 13,000+ lines of code in describe.mjs may never actually have been looked at. If you find a bug, please file an issue. This library is on npm and powers backslash commands in the Neon SQL Editor. Usage The key export is the describe() function: cmd (string) is the desired describe command, including the leading backslash, such as \\d (don't forget you may need to escape the backslash in a literal string). dbName (string) is the name of the connected database. runQuery is an async function that takes a SQL query (string) and must return unparsed query results in the same format used by node-postgres when specifying rowMode: 'array' . outputFn is a functi","default_branch":null,"files":null,"tree":[],"storefront":"/r/neondatabase","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/neondatabase/psql-describe/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}