Skip to content

Releases: Dentrax/kubesql

v0.1.0

12 Apr 15:58
194ed42
Compare
Choose a tag to compare

v0.1.0

  • Implement sqlparser
  • Implement kube-rs
  • Implement prettytable-rs
  • Validate if given namespace(s) and context(s) are really exist
  • Implement base CLI flags -f, --file and -q, --query
$ k8sql --file kube.sql
$ k8sql --query "SELECT namespace FROM context WHERE pod.status.phase = 'Running'"
  • This should work:
SELECT namespace1, namespace2
FROM context1, context2
WHERE pod.status.phase = 'Running' AND deployment.metadata.name = 'my-awesome-deployment'
  • It should print:
+----------------+---------------------------------+---------------------------------+
| KIND / CONTEXT | context1                        | context2                        |
+----------------+---------------------------------+---------------------------------+
| pod            | +-------+-------+               | +-------+-------+               |
|                | | ns1   | ns2   |               | | ns1   | ns2   |               |
|                | +-------+-------+               | +-------+-------+               |
|                | | pod-1 | pod-1 |               | | pod-2 | pod-2 |               |
|                | +-------+-------+               | +-------+-------+               |
+----------------+---------------------------------+---------------------------------+
| deployment     | +--------------+--------------+ | +--------------+--------------+ |
|                | | ns1          | ns2          | | | ns1          | ns2          | |
|                | +--------------+--------------+ | +--------------+--------------+ |
|                | | deployment-1 | deployment-1 | | | deployment-2 | deployment-2 | |
|                | +--------------+--------------+ | +--------------+--------------+ |
+----------------+---------------------------------+---------------------------------+
  • Print conditions:
  1. Printer should not insert pod row if does not given in WHERE statement
  2. Printer should not insert deployment row if does not given in WHERE statement