Skip to content

v0.1.0

Latest
Compare
Choose a tag to compare
@Dentrax Dentrax released this 12 Apr 15:58
· 5 commits to main since this release
194ed42

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