A co-worker that lived in his terminal used jsqsh[1] for simple queries to an Oracle DB when he did not need DBeaver. Jsqsh appears to no longer be maintained and I'm not quite sure how fast it is, but it still might be worth looking into. There is also usql[2] that you might be able to build something on top of.
[1]https://github.com/scgray/jsqsh [2]https://github.com/xo/usql