diff -Nru omnidb-2.16.0+ds/debian/changelog omnidb-2.17.0+ds/debian/changelog --- omnidb-2.16.0+ds/debian/changelog 2020-01-25 04:37:41.000000000 +0000 +++ omnidb-2.17.0+ds/debian/changelog 2020-01-28 13:01:41.000000000 +0000 @@ -1,8 +1,8 @@ -omnidb (2.16.0+ds-4build1) focal; urgency=medium +omnidb (2.17.0+ds-1) unstable; urgency=medium - * No-change rebuild to build with python3.8. + * New upstream version. - -- Matthias Klose Sat, 25 Jan 2020 04:37:41 +0000 + -- Christoph Berg Tue, 28 Jan 2020 14:01:41 +0100 omnidb (2.16.0+ds-4) unstable; urgency=medium diff -Nru omnidb-2.16.0+ds/Dockerfile omnidb-2.17.0+ds/Dockerfile --- omnidb-2.16.0+ds/Dockerfile 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/Dockerfile 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ FROM debian:stable-slim -ENV OMNIDB_VERSION=2.14.0 +ENV OMNIDB_VERSION=2.17.0 ENV SERVICE_USER=omnidb WORKDIR /${SERVICE_USER} diff -Nru omnidb-2.16.0+ds/.gitignore omnidb-2.17.0+ds/.gitignore --- omnidb-2.16.0+ds/.gitignore 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/.gitignore 2019-12-05 15:30:40.000000000 +0000 @@ -15,4 +15,4 @@ omnidb_app/omnidb-gui* omnidb_app/package-lock.json *.DS_Store - +*.idea Binary files /tmp/tmpXmjju2/fWHdPItys4/omnidb-2.16.0+ds/OmniDB/db.sqlite3 and /tmp/tmpXmjju2/VdmO6YYoTU/omnidb-2.17.0+ds/OmniDB/db.sqlite3 differ diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/app_centos7/build.sh omnidb-2.17.0+ds/OmniDB/deploy/app_centos7/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/app_centos7/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/app_centos7/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -e -VERSION=2.16.0 +VERSION=2.17.0 ARCH=centos-amd64 echo "Installing OmniDB dependencies..." @@ -45,6 +45,9 @@ mkdir deploy/packages cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server chmod 777 dist/omnidb-server/OmniDB_app/static/temp/ +chmod 777 dist/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 dist/omnidb-server/OmniDB_app/plugins/ +chmod 777 dist/omnidb-server/OmniDB_app/plugins/temp_loaded/ rm -rf ~/OmniDB/omnidb_app/omnidb-server mv dist/omnidb-server ~/OmniDB/omnidb_app rm -rf dist diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/app_debian8/build.sh omnidb-2.17.0+ds/OmniDB/deploy/app_debian8/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/app_debian8/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/app_debian8/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=2.16.0 +VERSION=2.17.0 ARCH=debian-amd64 echo "Installing OmniDB dependencies..." @@ -45,6 +45,9 @@ mkdir deploy/packages cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server chmod 777 dist/omnidb-server/OmniDB_app/static/temp/ +chmod 777 dist/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 dist/omnidb-server/OmniDB_app/plugins/ +chmod 777 dist/omnidb-server/OmniDB_app/plugins/temp_loaded/ rm -rf ~/OmniDB/omnidb_app/omnidb-server mv dist/omnidb-server ~/OmniDB/omnidb_app rm -rf dist @@ -120,6 +123,14 @@ Plugin package includes a PostgreSQL plugin to enable PLpgSQL function debugger. OmniDB is supported by 2ndQuadrant (http://www.2ndquadrant.com) EOF +cat > DEBIAN/postinst << EOF +#!/bin/bash +chmod 777 /opt/omnidb-app/resources/app/omnidb-server/OmniDB_app/static/temp/ +chmod 777 /opt/omnidb-app/resources/app/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 /opt/omnidb-app/resources/app/omnidb-server/OmniDB_app/plugins/ +chmod 777 /opt/omnidb-app/resources/app/omnidb-server/OmniDB_app/plugins/temp_loaded/ +EOF +chmod 755 DEBIAN/postinst cd .. dpkg -b omnidb-app_$VERSION-$ARCH echo "Done" diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/app_debian8/Dockerfile omnidb-2.17.0+ds/OmniDB/deploy/app_debian8/Dockerfile --- omnidb-2.16.0+ds/OmniDB/deploy/app_debian8/Dockerfile 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/app_debian8/Dockerfile 2019-12-05 15:30:40.000000000 +0000 @@ -1,4 +1,4 @@ -FROM debian:oldstable-slim +FROM debian:jessie-slim MAINTAINER William Ivanski USER root diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/app_debian8/README.md omnidb-2.17.0+ds/OmniDB/deploy/app_debian8/README.md --- omnidb-2.16.0+ds/OmniDB/deploy/app_debian8/README.md 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/app_debian8/README.md 2019-12-05 15:30:40.000000000 +0000 @@ -3,7 +3,7 @@ Download Debian 8 base image: ``` -docker pull debian:oldstable-slim +docker pull debian:jessie-slim ``` For more information about Debian official docker images, please check here: diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos6/build.sh omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos6/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos6/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos6/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=2.16.0 +VERSION=2.17.0 ARCH=centos-amd64 cd ~/OmniDB/omnidb_plugin @@ -9,12 +9,6 @@ rm -f *.o echo "Done." -echo "Compiling for 9.3... " -rm -f *.o -gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -L /usr/pgsql-9.3/lib -lpq -I /usr/pgsql-9.3/include -I /usr/pgsql-9.3/include/server -gcc -fPIC -o omnidb_plugin_93.so omnidb_plugin.o -L /usr/pgsql-9.3/lib -lpq -shared -echo "Done." - echo "Compiling for 9.4... " rm -f *.o gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -L /usr/pgsql-9.4/lib -lpq -I /usr/pgsql-9.4/include -I /usr/pgsql-9.4/include/server @@ -45,6 +39,12 @@ gcc -fPIC -o omnidb_plugin_11.so omnidb_plugin.o -L /usr/pgsql-11/lib -lpq -shared echo "Done." +echo "Compiling for 12... " +rm -f *.o +gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -L /usr/pgsql-12/lib -lpq -I /usr/pgsql-12/include -I /usr/pgsql-12/include/server +gcc -fPIC -o omnidb_plugin_12.so omnidb_plugin.o -L /usr/pgsql-12/lib -lpq -shared +echo "Done." + echo -n "Cleaning... " rm -f *.o echo "Done." diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos6/Dockerfile omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos6/Dockerfile --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos6/Dockerfile 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos6/Dockerfile 2019-12-05 15:30:40.000000000 +0000 @@ -8,19 +8,13 @@ RUN yum -y update \ && yum -y install epel-release \ - && yum install -y gcc gcc-c++ make git patch rpm-build \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/pgdg-redhat11-11-2.noarch.rpm \ - && yum -y check-update \ - && yum -y install postgresql93 postgresql93-server postgresql93-libs postgresql93-contrib postgresql93-devel \ + && yum -y install gcc gcc-c++ make git patch rpm-build \ + && rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm \ && yum -y install postgresql94 postgresql94-server postgresql94-libs postgresql94-contrib postgresql94-devel \ && yum -y install postgresql95 postgresql95-server postgresql95-libs postgresql95-contrib postgresql95-devel \ && yum -y install postgresql96 postgresql96-server postgresql96-libs postgresql96-contrib postgresql96-devel \ && yum -y install postgresql10 postgresql10-server postgresql10-libs postgresql10-contrib postgresql10-devel \ - && yum -y install postgresql11 postgresql11-server postgresql11-libs postgresql11-contrib postgresql11-devel + && yum -y install postgresql11 postgresql11-server postgresql11-libs postgresql11-contrib postgresql11-devel \ + && yum -y install postgresql12 postgresql12-server postgresql12-libs postgresql12-contrib postgresql12-devel COPY clone.sh $HOME/ diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos7/build.sh omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos7/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos7/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos7/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=2.16.0 +VERSION=2.17.0 ARCH=centos-amd64 cd ~/OmniDB/omnidb_plugin @@ -9,12 +9,6 @@ rm -f *.o echo "Done." -echo "Compiling for 9.3... " -rm -f *.o -gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -L /usr/pgsql-9.3/lib -lpq -I /usr/pgsql-9.3/include -I /usr/pgsql-9.3/include/server -gcc -fPIC -o omnidb_plugin_93.so omnidb_plugin.o -L /usr/pgsql-9.3/lib -lpq -shared -echo "Done." - echo "Compiling for 9.4... " rm -f *.o gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -L /usr/pgsql-9.4/lib -lpq -I /usr/pgsql-9.4/include -I /usr/pgsql-9.4/include/server @@ -45,6 +39,12 @@ gcc -fPIC -o omnidb_plugin_11.so omnidb_plugin.o -L /usr/pgsql-11/lib -lpq -shared echo "Done." +echo "Compiling for 12... " +rm -f *.o +gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -L /usr/pgsql-12/lib -lpq -I /usr/pgsql-12/include -I /usr/pgsql-12/include/server +gcc -fPIC -o omnidb_plugin_12.so omnidb_plugin.o -L /usr/pgsql-12/lib -lpq -shared +echo "Done." + echo -n "Cleaning... " rm -f *.o echo "Done." diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos7/Dockerfile omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos7/Dockerfile --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_centos7/Dockerfile 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_centos7/Dockerfile 2019-12-05 15:30:40.000000000 +0000 @@ -8,19 +8,13 @@ RUN yum -y update \ && yum -y install epel-release \ - && yum install -y gcc gcc-c++ make git patch rpm-build \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm \ - && rpm -ivh https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat11-11-2.noarch.rpm \ - && yum -y check-update \ - && yum -y install postgresql93 postgresql93-server postgresql93-libs postgresql93-contrib postgresql93-devel \ + && yum -y install gcc gcc-c++ make git patch rpm-build \ + && rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm \ && yum -y install postgresql94 postgresql94-server postgresql94-libs postgresql94-contrib postgresql94-devel \ && yum -y install postgresql95 postgresql95-server postgresql95-libs postgresql95-contrib postgresql95-devel \ && yum -y install postgresql96 postgresql96-server postgresql96-libs postgresql96-contrib postgresql96-devel \ && yum -y install postgresql10 postgresql10-server postgresql10-libs postgresql10-contrib postgresql10-devel \ - && yum -y install postgresql11 postgresql11-server postgresql11-libs postgresql11-contrib postgresql11-devel + && yum -y install postgresql11 postgresql11-server postgresql11-libs postgresql11-contrib postgresql11-devel \ + && yum -y install postgresql12 postgresql12-server postgresql12-libs postgresql12-contrib postgresql12-devel COPY clone.sh $HOME/ diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_debian8/build.sh omnidb-2.17.0+ds/OmniDB/deploy/plugin_debian8/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_debian8/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_debian8/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=2.16.0 +VERSION=2.17.0 ARCH=debian-amd64 cd ~/OmniDB/omnidb_plugin @@ -9,12 +9,6 @@ rm -f *.o echo "Done." -echo "Compiling for 9.3... " -rm -f *.o -gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/include/postgresql -I /usr/include/postgresql/9.3/server -gcc -fPIC -o omnidb_plugin_93.so omnidb_plugin.o -lpq -shared -echo "Done." - echo "Compiling for 9.4... " rm -f *.o gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/include/postgresql -I /usr/include/postgresql/9.4/server @@ -45,6 +39,12 @@ gcc -fPIC -o omnidb_plugin_11.so omnidb_plugin.o -lpq -shared echo "Done." +echo "Compiling for 12... " +rm -f *.o +gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/include/postgresql -I /usr/include/postgresql/12/server +gcc -fPIC -o omnidb_plugin_12.so omnidb_plugin.o -lpq -shared +echo "Done." + echo -n "Cleaning... " rm -f *.o echo "Done." diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_debian8/Dockerfile omnidb-2.17.0+ds/OmniDB/deploy/plugin_debian8/Dockerfile --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_debian8/Dockerfile 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_debian8/Dockerfile 2019-12-05 15:30:40.000000000 +0000 @@ -1,4 +1,4 @@ -FROM debian:oldstable-slim +FROM debian:jessie-slim MAINTAINER William Ivanski USER root @@ -11,6 +11,6 @@ && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ && wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - \ && apt-get update -y \ - && apt-get -y install build-essential git postgresql-server-dev-9.3 postgresql-server-dev-9.4 postgresql-server-dev-9.5 postgresql-server-dev-9.6 postgresql-server-dev-10 postgresql-server-dev-11 libpq-dev + && apt-get -y install build-essential git postgresql-server-dev-9.4 postgresql-server-dev-9.5 postgresql-server-dev-9.6 postgresql-server-dev-10 postgresql-server-dev-11 postgresql-server-dev-12 libpq-dev COPY clone.sh $HOME/ diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_debian8/README.md omnidb-2.17.0+ds/OmniDB/deploy/plugin_debian8/README.md --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_debian8/README.md 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_debian8/README.md 2019-12-05 15:30:40.000000000 +0000 @@ -3,7 +3,7 @@ Download Debian 8 base image: ``` -docker pull debian:oldstable-slim +docker pull debian:jessie-slim ``` For more information about Debian official docker images, please check here: diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_freebsd/compile_instructions.txt omnidb-2.17.0+ds/OmniDB/deploy/plugin_freebsd/compile_instructions.txt --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_freebsd/compile_instructions.txt 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_freebsd/compile_instructions.txt 2019-12-05 15:30:40.000000000 +0000 @@ -4,31 +4,36 @@ cd ~/OmniDB/omnidb_plugin pkg install postgresql93-server-9.3.24_1 postgresql93-client-9.3.24_1 + gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server gcc -fPIC -o omnidb_plugin_93.so omnidb_plugin.o -lpq -shared pkg install postgresql94-server-9.4.19_1 postgresql94-client-9.4.19_1 + gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server gcc -fPIC -o omnidb_plugin_94.so omnidb_plugin.o -lpq -shared pkg install postgresql95-server-9.5.14_1 postgresql95-client-9.5.14_1 + gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server gcc -fPIC -o omnidb_plugin_95.so omnidb_plugin.o -lpq -shared pkg install postgresql96-server-9.6.10_1 postgresql96-client-9.6.10_1 + gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server gcc -fPIC -o omnidb_plugin_96.so omnidb_plugin.o -lpq -shared pkg install postgresql10-server-10.5_1 postgresql10-client-10.5_1 + gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server gcc -fPIC -o omnidb_plugin_10.so omnidb_plugin.o -lpq -shared pkg install postgresql11-server-11.0_2 postgresql11-client-11.0 + gcc -fPIC -c -o omnidb_plugin.o omnidb_plugin.c -lpq -I /usr/local/include/postgresql -I /usr/local/include/postgresql/server gcc -fPIC -o omnidb_plugin_11.so omnidb_plugin.o -lpq -shared rm -f *.o - cd .. -mv omnidb_plugin/ omnidb-plugin_2.16.0-freebsd-amd64 -tar -czvf omnidb-plugin_2.16.0-freebsd-amd64.tar.gz omnidb-plugin_2.16.0-freebsd-amd64/ +mv omnidb_plugin/ omnidb-plugin_2.17.0-freebsd-amd64 +tar -czvf omnidb-plugin_2.17.0-freebsd-amd64.tar.gz omnidb-plugin_2.17.0-freebsd-amd64/ diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/plugin_freebsd/test_instructions.txt omnidb-2.17.0+ds/OmniDB/deploy/plugin_freebsd/test_instructions.txt --- omnidb-2.16.0+ds/OmniDB/deploy/plugin_freebsd/test_instructions.txt 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/plugin_freebsd/test_instructions.txt 2019-12-05 15:30:40.000000000 +0000 @@ -3,11 +3,11 @@ su postgres cd -wget --no-check-certificate https://omnidb.org/dist/2.16.0/omnidb-plugin_2.16.0-freebsd-amd64.tar.gz -tar -xzvf omnidb-plugin_2.16.0-freebsd-amd64.tar.gz +wget --no-check-certificate https://omnidb.org/dist/2.17.0/omnidb-plugin_2.17.0-freebsd-amd64.tar.gz +tar -xzvf omnidb-plugin_2.17.0-freebsd-amd64.tar.gz exit -cp /var/db/postgres/omnidb-plugin_2.16.0-freebsd-amd64/omnidb_plugin_10.so /usr/local/lib/postgresql/omnidb_plugin.so +cp /var/db/postgres/omnidb-plugin_2.17.0-freebsd-amd64/omnidb_plugin_10.so /usr/local/lib/postgresql/omnidb_plugin.so service zerotier onestart zerotier-cli join @@ -28,7 +28,7 @@ create user omnidb with password 'omnidb'; create database omnidb_tests owner omnidb; -cd ~/omnidb-plugin_2.16.0-freebsd-amd64 +cd ~/omnidb-plugin_2.17.0-freebsd-amd64 psql -d omnidb_tests -f debugger_schema.sql psql -d omnidb_tests -f sample_functions.sql psql -d omnidb_tests -c 'grant all on schema omnidb to omnidb' diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/requirements_for_deploy_app.txt omnidb-2.17.0+ds/OmniDB/deploy/requirements_for_deploy_app.txt --- omnidb-2.16.0+ds/OmniDB/deploy/requirements_for_deploy_app.txt 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/requirements_for_deploy_app.txt 2019-12-05 15:30:40.000000000 +0000 @@ -1,2 +1,2 @@ -CherryPy>=11.0.0 -PyInstaller>=3.2.1 +CherryPy==18.1.1 +PyInstaller==3.5 \ No newline at end of file diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/requirements_for_deploy_server.txt omnidb-2.17.0+ds/OmniDB/deploy/requirements_for_deploy_server.txt --- omnidb-2.16.0+ds/OmniDB/deploy/requirements_for_deploy_server.txt 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/requirements_for_deploy_server.txt 2019-12-05 15:30:40.000000000 +0000 @@ -1,2 +1,2 @@ -CherryPy>=11.0.0 -PyInstaller>=3.2.1 +CherryPy==18.1.1 +PyInstaller==3.5 diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/server_centos6/build.sh omnidb-2.17.0+ds/OmniDB/deploy/server_centos6/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/server_centos6/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/server_centos6/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,8 +1,14 @@ #!/bin/sh -e -VERSION=2.16.0 +VERSION=2.17.0 ARCH=centos-amd64 +echo "Downgrading Django version..." +# See https://code.djangoproject.com/ticket/29624 +# and https://github.com/OmniDB/OmniDB/issues/808 +sed -i -e "s/Django==2.1.11/Django==2.0.13/" ~/OmniDB/requirements.txt +echo "Done" + echo "Installing OmniDB dependencies..." pip install pip --upgrade pip install setuptools --upgrade @@ -37,6 +43,9 @@ cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server mv dist/omnidb-server deploy/packages chmod 777 deploy/packages/omnidb-server/OmniDB_app/static/temp/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/plugins/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/plugins/temp_loaded/ rm -rf dist echo "Done." diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/server_centos7/build.sh omnidb-2.17.0+ds/OmniDB/deploy/server_centos7/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/server_centos7/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/server_centos7/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -e -VERSION=2.16.0 +VERSION=2.17.0 ARCH=centos-amd64 echo "Installing OmniDB dependencies..." @@ -37,6 +37,9 @@ cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server mv dist/omnidb-server deploy/packages chmod 777 deploy/packages/omnidb-server/OmniDB_app/static/temp/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/plugins/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/plugins/temp_loaded/ rm -rf dist echo "Done." diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/server_debian8/build.sh omnidb-2.17.0+ds/OmniDB/deploy/server_debian8/build.sh --- omnidb-2.16.0+ds/OmniDB/deploy/server_debian8/build.sh 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/server_debian8/build.sh 2019-12-05 15:30:40.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=2.16.0 +VERSION=2.17.0 ARCH=debian-amd64 echo "Installing OmniDB dependencies..." @@ -37,6 +37,9 @@ cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server mv dist/omnidb-server deploy/packages chmod 777 deploy/packages/omnidb-server/OmniDB_app/static/temp/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/plugins/ +chmod 777 deploy/packages/omnidb-server/OmniDB_app/plugins/temp_loaded/ rm -rf dist echo "Done." @@ -113,6 +116,10 @@ chmod 755 DEBIAN/preinst cat > DEBIAN/postinst << EOF #!/bin/bash +chmod 777 /opt/omnidb-server/OmniDB_app/static/temp/ +chmod 777 /opt/omnidb-server/OmniDB_app/static/plugins/ +chmod 777 /opt/omnidb-server/OmniDB_app/plugins/ +chmod 777 /opt/omnidb-server/OmniDB_app/plugins/temp_loaded/ systemctl daemon-reload systemctl enable omnidb systemctl start omnidb diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/server_debian8/Dockerfile omnidb-2.17.0+ds/OmniDB/deploy/server_debian8/Dockerfile --- omnidb-2.16.0+ds/OmniDB/deploy/server_debian8/Dockerfile 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/server_debian8/Dockerfile 2019-12-05 15:30:40.000000000 +0000 @@ -1,4 +1,4 @@ -FROM debian:oldstable-slim +FROM debian:jessie-slim MAINTAINER William Ivanski USER root diff -Nru omnidb-2.16.0+ds/OmniDB/deploy/server_debian8/README.md omnidb-2.17.0+ds/OmniDB/deploy/server_debian8/README.md --- omnidb-2.16.0+ds/OmniDB/deploy/server_debian8/README.md 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/deploy/server_debian8/README.md 2019-12-05 15:30:40.000000000 +0000 @@ -3,7 +3,7 @@ Download Debian 8 base image: ``` -docker pull debian:oldstable-slim +docker pull debian:jessie-slim ``` For more information about Debian official docker images, please check here: diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB/custom_settings.py omnidb-2.17.0+ds/OmniDB/OmniDB/custom_settings.py --- omnidb-2.16.0+ds/OmniDB/OmniDB/custom_settings.py 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB/custom_settings.py 2019-12-05 15:30:40.000000000 +0000 @@ -1,7 +1,7 @@ import os -OMNIDB_VERSION = 'OmniDB 2.16.0' -OMNIDB_SHORT_VERSION = '2.16.0' +OMNIDB_VERSION = 'OmniDB 2.17.0' +OMNIDB_SHORT_VERSION = '2.17.0' OMNIDB_ADDRESS = '127.0.0.1' OMNIDB_WEBSOCKET_PORT = 25482 DEV_MODE = False diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.16.0.sql omnidb-2.17.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.16.0.sql --- omnidb-2.16.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.16.0.sql 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.16.0.sql 1970-01-01 00:00:00.000000000 +0000 @@ -1,634 +0,0 @@ -CREATE TABLE db_type ( - dbt_st_name varchar(40), - dbt_in_enabled integer, - constraint pk_db_type primary key (dbt_st_name) -);--omnidb-- -INSERT INTO db_type VALUES('sqlite',0);--omnidb-- -INSERT INTO db_type VALUES('mysql',1);--omnidb-- -INSERT INTO db_type VALUES('postgresql',1);--omnidb-- -INSERT INTO db_type VALUES('firebird',0);--omnidb-- -INSERT INTO db_type VALUES('oracle',1);--omnidb-- -INSERT INTO db_type VALUES('sqlserver',0);--omnidb-- -INSERT INTO db_type VALUES('access',0);--omnidb-- -INSERT INTO db_type VALUES('sqlce',0);--omnidb-- -INSERT INTO db_type VALUES('mariadb',1);--omnidb-- -INSERT INTO db_type VALUES('filedb',0);--omnidb-- -INSERT INTO db_type VALUES('terminal',1);--omnidb-- - -CREATE TABLE data_categories ( - cat_st_name varchar(40), - cat_st_description varchar(100), - cat_st_class varchar(40), - constraint pk_data_categories primary key (cat_st_name) -);--omnidb-- -INSERT INTO data_categories VALUES('bigint','Big Integer','numeric');--omnidb-- -INSERT INTO data_categories VALUES('boolean','Boolean','other');--omnidb-- -INSERT INTO data_categories VALUES('char','String','text');--omnidb-- -INSERT INTO data_categories VALUES('date','Date Only','other');--omnidb-- -INSERT INTO data_categories VALUES('datetime','Date Time','other');--omnidb-- -INSERT INTO data_categories VALUES('decimal','Decimal','numeric');--omnidb-- -INSERT INTO data_categories VALUES('fp','Floating Point','numeric');--omnidb-- -INSERT INTO data_categories VALUES('integer','Integer','numeric');--omnidb-- -INSERT INTO data_categories VALUES('smallint','Small Integer','numeric');--omnidb-- -INSERT INTO data_categories VALUES('text','Long String','text');--omnidb-- -INSERT INTO data_categories VALUES('time','Time Only','other');--omnidb-- -INSERT INTO data_categories VALUES('varchar','Var String','text');--omnidb-- - -CREATE TABLE data_types ( - cat_st_name varchar(40), - dbt_st_name varchar(40), - dt_type varchar(100), - dt_in_sufix integer, - dt_st_writeformat varchar(1000), - dt_st_readformat varchar(1000), - dt_st_compareformat varchar(1000), - constraint pk_data_types primary key (dbt_st_name, dt_type), - constraint data_types_fk_0 foreign key (cat_st_name) references data_categories (cat_st_name), - constraint data_types_fk_1 foreign key (dbt_st_name) references db_type (dbt_st_name) -);--omnidb-- -INSERT INTO data_types VALUES('text','access','binary',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('boolean','access','boolean',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','access','byte',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','access','complex_type',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','access','double',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','access','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','access','guid',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','access','int',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','access','long',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','access','memo',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','access','money',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','access','numeric',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','access','ole',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('datetime','access','short_date_time',0,'''#''','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'') as #','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'')');--omnidb-- -INSERT INTO data_types VALUES('text','access','text',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','firebird','bigint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','firebird','char',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('date','firebird','date',0,'cast(''#'' as date)',replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'') as #','\n',char(10)),replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'')','\n',char(10)));--omnidb-- -INSERT INTO data_types VALUES('decimal','firebird','decimal',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','firebird','double',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','firebird','double precision',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','firebird','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','firebird','int',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','firebird','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','firebird','nchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','firebird','ntext',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','firebird','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','firebird','nvarchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','firebird','real',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','firebird','smallint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','firebird','BLOB SUB_TYPE TEXT',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('time','firebird','time',0,'cast(''#'' as time)',replace('lpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'') as #','\n',char(10)),replace('lpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'')','\n',char(10)));--omnidb-- -INSERT INTO data_types VALUES('datetime','firebird','timestamp',0,'cast(''#'' as timestamp)',replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '' '' ||\nlpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'') as #','\n',char(10)),replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '' '' ||\nlpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'')','\n',char(10)));--omnidb-- -INSERT INTO data_types VALUES('smallint','firebird','tinyint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','firebird','varchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','mysql','bigint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','mysql','bit',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('boolean','mysql','boolean',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','mysql','char',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('date','mysql','date',0,'STR_TO_DATE(''#'', ''%Y-%m-%d'')','DATE_FORMAT(#, ''%Y-%m-%d'') as #','DATE_FORMAT(#, ''%Y-%m-%d'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','mysql','datetime',0,'STR_TO_DATE(''#'', ''%Y-%m-%d %H:%i:%s'')','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'') as #','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'')');--omnidb-- -INSERT INTO data_types VALUES('decimal','mysql','decimal',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','mysql','double',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','mysql','double precision',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','mysql','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','mysql','int',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','mysql','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','mysql','mediumint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','mysql','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','mysql','smallint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','mysql','text',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','mysql','tinyint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','mysql','varchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','oracle','binary_double',0,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('fp','oracle','binary_float',0,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('char','oracle','char',1,'''#''','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','date',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('fp','oracle','double',0,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('fp','oracle','float',0,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','oracle','integer',0,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('char','oracle','nchar',1,'''#''','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','oracle','number',2,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','oracle','numeric',2,'#','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','oracle','nvarchar2',1,'''#''','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(0)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(1)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(2)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(3)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(4)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(5)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(6)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(7)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(8)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','oracle','timestamp(9)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- -INSERT INTO data_types VALUES('varchar','oracle','varchar',1,'''#''','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','oracle','varchar2',1,'''#''','to_char(#) as #','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','postgresql','bigint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','postgresql','bigserial',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('boolean','postgresql','boolean',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','postgresql','char',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','postgresql','character',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','postgresql','character varying',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('date','postgresql','date',0,'''#''','to_char(#::date, ''YYYY-mm-dd'') as #','to_char(#::date, ''YYYY-mm-dd'')');--omnidb-- -INSERT INTO data_types VALUES('decimal','postgresql','decimal',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','postgresql','double precision',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','postgresql','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','postgresql','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','postgresql','money',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','postgresql','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','postgresql','real',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','postgresql','serial',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','postgresql','smallint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','postgresql','smallserial',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','postgresql','text',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('time','postgresql','time with time zone',0,'''#''','to_char(#::time, ''hh24:mi:ss'') as #','to_char(#::time, ''hh24:mi:ss'')');--omnidb-- -INSERT INTO data_types VALUES('time','postgresql','time without time zone',0,'''#''','to_char(#::time, ''hh24:mi:ss'') as #','to_char(#::time, ''hh24:mi:ss'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','postgresql','timestamp with time zone',0,'''#''','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'') as #','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','postgresql','timestamp without time zone',0,'''#''','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'') as #','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'')');--omnidb-- -INSERT INTO data_types VALUES('varchar','postgresql','varchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','sqlite','char',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','sqlite','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','sqlite','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','sqlite','nvarchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlite','real',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','sqlite','varchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','sqlserver','bigint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlserver','binary',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlserver','bit',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','sqlserver','char',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('date','sqlserver','date',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('datetime','sqlserver','datetime',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('datetime','sqlserver','datetime2',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('datetime','sqlserver','datetimeoffset',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('decimal','sqlserver','decimal',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlserver','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlserver','image',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','sqlserver','int',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlserver','money',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','sqlserver','nchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlserver','ntext',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','sqlserver','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','sqlserver','nvarchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlserver','real',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('datetime','sqlserver','smalldatetime',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('smallint','sqlserver','smallint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlserver','smallmoney',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlserver','text',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('time','sqlserver','time',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('datetime','sqlserver','timestamp',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('smallint','sqlserver','tinyint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlserver','varbinary',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','sqlserver','varchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','sqlserver','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','oracle','clob',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlite','text',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('datetime','access','datetime',0,'''#''','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'') as #','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'')');--omnidb-- -INSERT INTO data_types VALUES('time','mysql','time',0,'STR_TO_DATE(''#'', ''%H:%i:%s'')','DATE_FORMAT(#, ''%H:%i:%s'') as #','DATE_FORMAT(#, ''%H:%i:%s'')');--omnidb-- -INSERT INTO data_types VALUES('bigint','sqlce','bigint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlce','binary',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlce','bit',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('datetime','sqlce','datetime',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlce','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlce','image',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','sqlce','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlce','money',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlce','ntext',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','sqlce','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','sqlce','real',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','sqlce','smallint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','sqlce','tinyint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','sqlce','varbinary',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('bigint','mariadb','bigint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','mariadb','bit',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('boolean','mariadb','boolean',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('char','mariadb','char',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('date','mariadb','date',0,'STR_TO_DATE(''#'', ''%Y-%m-%d'')','DATE_FORMAT(#, ''%Y-%m-%d'') as #','DATE_FORMAT(#, ''%Y-%m-%d'')');--omnidb-- -INSERT INTO data_types VALUES('datetime','mariadb','datetime',0,'STR_TO_DATE(''#'', ''%Y-%m-%d %H:%i:%s'')','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'') as #','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'')');--omnidb-- -INSERT INTO data_types VALUES('decimal','mariadb','decimal',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','mariadb','double',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','mariadb','double precision',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('fp','mariadb','float',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','mariadb','int',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','mariadb','integer',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('integer','mariadb','mediumint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('decimal','mariadb','numeric',2,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('smallint','mariadb','smallint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('text','mariadb','text',0,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('time','mariadb','time',0,'STR_TO_DATE(''#'', ''%H:%i:%s'')','DATE_FORMAT(#, ''%H:%i:%s'') as #','DATE_FORMAT(#, ''%H:%i:%s'')');--omnidb-- -INSERT INTO data_types VALUES('smallint','mariadb','tinyint',0,'#','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','mariadb','varchar',1,'''#''','#','#');--omnidb-- -INSERT INTO data_types VALUES('varchar','filedb','varchar',0,'''#''','#','#');--omnidb-- - -CREATE TABLE representatives ( - cat_st_name varchar(40), - dbt_st_name varchar(40), - rep_st_default varchar(100), - dt_type varchar(100), - constraint pk_rep primary key (cat_st_name, dbt_st_name), - constraint fk_rep_dc foreign key (cat_st_name) references data_categories (cat_st_name), - constraint fk_rep_dbt foreign key (dbt_st_name) references db_type (dbt_st_name), - constraint fk_rep_dt foreign key (dbt_st_name, dt_type) references data_types (dbt_st_name, dt_type) -);--omnidb-- -INSERT INTO representatives VALUES('smallint','oracle','number(5,0)','number');--omnidb-- -INSERT INTO representatives VALUES('integer','oracle','number(10,0)','number');--omnidb-- -INSERT INTO representatives VALUES('bigint','oracle','number(19,0)','number');--omnidb-- -INSERT INTO representatives VALUES('decimal','oracle','number(38,0)','number');--omnidb-- -INSERT INTO representatives VALUES('fp','oracle','number(38,4)','number');--omnidb-- -INSERT INTO representatives VALUES('boolean','oracle','char(1)','char');--omnidb-- -INSERT INTO representatives VALUES('varchar','oracle','varchar2(1000)','varchar2');--omnidb-- -INSERT INTO representatives VALUES('boolean','postgresql','boolean','boolean');--omnidb-- -INSERT INTO representatives VALUES('smallint','postgresql','smallint','smallint');--omnidb-- -INSERT INTO representatives VALUES('integer','postgresql','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('bigint','postgresql','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('decimal','postgresql','numeric','numeric');--omnidb-- -INSERT INTO representatives VALUES('fp','postgresql','double precision','double precision');--omnidb-- -INSERT INTO representatives VALUES('fp','mysql','double precision','double precision');--omnidb-- -INSERT INTO representatives VALUES('smallint','mysql','smallint','smallint');--omnidb-- -INSERT INTO representatives VALUES('integer','mysql','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('bigint','mysql','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('varchar','mysql','varchar(1000)','varchar');--omnidb-- -INSERT INTO representatives VALUES('boolean','mysql','boolean','boolean');--omnidb-- -INSERT INTO representatives VALUES('varchar','postgresql','character varying','character varying');--omnidb-- -INSERT INTO representatives VALUES('decimal','mysql','decimal(38,0)','decimal');--omnidb-- -INSERT INTO representatives VALUES('decimal','firebird','decimal(38,0)','decimal');--omnidb-- -INSERT INTO representatives VALUES('smallint','firebird','smallint','smallint');--omnidb-- -INSERT INTO representatives VALUES('integer','firebird','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('bigint','firebird','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('varchar','firebird','varchar(1000)','varchar');--omnidb-- -INSERT INTO representatives VALUES('boolean','firebird','char(1)','char');--omnidb-- -INSERT INTO representatives VALUES('fp','firebird','double precision','double precision');--omnidb-- -INSERT INTO representatives VALUES('datetime','postgresql','timestamp without time zone','timestamp without time zone');--omnidb-- -INSERT INTO representatives VALUES('decimal','sqlite','numeric(38,0)','numeric');--omnidb-- -INSERT INTO representatives VALUES('smallint','sqlite','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('integer','sqlite','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('bigint','sqlite','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('varchar','sqlite','varchar(1000)','varchar');--omnidb-- -INSERT INTO representatives VALUES('boolean','sqlite','char(1)','char');--omnidb-- -INSERT INTO representatives VALUES('fp','sqlite','real','real');--omnidb-- -INSERT INTO representatives VALUES('varchar','sqlserver','varchar(1000)','varchar');--omnidb-- -INSERT INTO representatives VALUES('char','firebird','char(1000)','char');--omnidb-- -INSERT INTO representatives VALUES('char','mysql','char(255)','char');--omnidb-- -INSERT INTO representatives VALUES('char','oracle','char(1000)','char');--omnidb-- -INSERT INTO representatives VALUES('char','postgresql','char(1000)','char');--omnidb-- -INSERT INTO representatives VALUES('char','sqlite','char(1000)','char');--omnidb-- -INSERT INTO representatives VALUES('char','sqlserver','char(1000)','char');--omnidb-- -INSERT INTO representatives VALUES('text','firebird','BLOB SUB_TYPE TEXT','BLOB SUB_TYPE TEXT');--omnidb-- -INSERT INTO representatives VALUES('text','mysql','text','text');--omnidb-- -INSERT INTO representatives VALUES('text','oracle','clob','clob');--omnidb-- -INSERT INTO representatives VALUES('text','postgresql','text','text');--omnidb-- -INSERT INTO representatives VALUES('text','sqlite','text','text');--omnidb-- -INSERT INTO representatives VALUES('text','sqlserver','text','text');--omnidb-- -INSERT INTO representatives VALUES('decimal','sqlserver','decimal(38,0)','decimal');--omnidb-- -INSERT INTO representatives VALUES('smallint','sqlserver','smallint','smallint');--omnidb-- -INSERT INTO representatives VALUES('integer','sqlserver','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('bigint','sqlserver','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('boolean','sqlserver','char(1)','char');--omnidb-- -INSERT INTO representatives VALUES('fp','sqlserver','real','real');--omnidb-- -INSERT INTO representatives VALUES('datetime','firebird','timestamp','timestamp');--omnidb-- -INSERT INTO representatives VALUES('datetime','mysql','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('datetime','oracle','date','date');--omnidb-- -INSERT INTO representatives VALUES('datetime','sqlite','text','text');--omnidb-- -INSERT INTO representatives VALUES('datetime','sqlserver','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('datetime','access','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('text','access','text','text');--omnidb-- -INSERT INTO representatives VALUES('smallint','access','int','int');--omnidb-- -INSERT INTO representatives VALUES('integer','access','int','int');--omnidb-- -INSERT INTO representatives VALUES('bigint','access','int','int');--omnidb-- -INSERT INTO representatives VALUES('fp','access','double','double');--omnidb-- -INSERT INTO representatives VALUES('boolean','access','boolean','boolean');--omnidb-- -INSERT INTO representatives VALUES('decimal','access','numeric','numeric');--omnidb-- -INSERT INTO representatives VALUES('char','access','text','text');--omnidb-- -INSERT INTO representatives VALUES('varchar','access','text','text');--omnidb-- -INSERT INTO representatives VALUES('date','postgresql','date','date');--omnidb-- -INSERT INTO representatives VALUES('time','postgresql','time without time zone','time without time zone');--omnidb-- -INSERT INTO representatives VALUES('time','sqlite','text','text');--omnidb-- -INSERT INTO representatives VALUES('date','sqlite','text','text');--omnidb-- -INSERT INTO representatives VALUES('date','mysql','date','date');--omnidb-- -INSERT INTO representatives VALUES('time','mysql','time','time');--omnidb-- -INSERT INTO representatives VALUES('time','firebird','time','time');--omnidb-- -INSERT INTO representatives VALUES('date','firebird','date','date');--omnidb-- -INSERT INTO representatives VALUES('date','oracle','date','date');--omnidb-- -INSERT INTO representatives VALUES('time','oracle','date','date');--omnidb-- -INSERT INTO representatives VALUES('date','access','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('time','access','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('date','sqlserver','date','date');--omnidb-- -INSERT INTO representatives VALUES('time','sqlserver','time','time');--omnidb-- -INSERT INTO representatives VALUES('varchar','sqlce','ntext','ntext');--omnidb-- -INSERT INTO representatives VALUES('char','sqlce','ntext','ntext');--omnidb-- -INSERT INTO representatives VALUES('text','sqlce','ntext','ntext');--omnidb-- -INSERT INTO representatives VALUES('decimal','sqlce','numeric(38,0)','numeric');--omnidb-- -INSERT INTO representatives VALUES('smallint','sqlce','smallint','smallint');--omnidb-- -INSERT INTO representatives VALUES('integer','sqlce','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('bigint','sqlce','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('boolean','sqlce','ntext','ntext');--omnidb-- -INSERT INTO representatives VALUES('fp','sqlce','real','real');--omnidb-- -INSERT INTO representatives VALUES('datetime','sqlce','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('date','sqlce','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('time','sqlce','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('fp','mariadb','double precision','double precision');--omnidb-- -INSERT INTO representatives VALUES('smallint','mariadb','smallint','smallint');--omnidb-- -INSERT INTO representatives VALUES('integer','mariadb','integer','integer');--omnidb-- -INSERT INTO representatives VALUES('bigint','mariadb','bigint','bigint');--omnidb-- -INSERT INTO representatives VALUES('varchar','mariadb','varchar(1000)','varchar');--omnidb-- -INSERT INTO representatives VALUES('boolean','mariadb','boolean','boolean');--omnidb-- -INSERT INTO representatives VALUES('decimal','mariadb','decimal(38,0)','decimal');--omnidb-- -INSERT INTO representatives VALUES('char','mariadb','char(255)','char');--omnidb-- -INSERT INTO representatives VALUES('text','mariadb','text','text');--omnidb-- -INSERT INTO representatives VALUES('datetime','mariadb','datetime','datetime');--omnidb-- -INSERT INTO representatives VALUES('date','mariadb','date','date');--omnidb-- -INSERT INTO representatives VALUES('time','mariadb','time','time');--omnidb-- -INSERT INTO representatives VALUES('varchar','filedb','varchar(1000)','varchar');--omnidb-- - -CREATE TABLE themes ( - theme_id integer not null, - theme_name varchar(50), - theme_type varchar(50), - constraint pk_themes primary key (theme_id) -);--omnidb-- -INSERT INTO themes VALUES(1,'omnidb','light');--omnidb-- -INSERT INTO themes VALUES(2,'chrome','light');--omnidb-- -INSERT INTO themes VALUES(3,'clouds','light');--omnidb-- -INSERT INTO themes VALUES(4,'crimson_editor','light');--omnidb-- -INSERT INTO themes VALUES(5,'dawn','light');--omnidb-- -INSERT INTO themes VALUES(6,'dreamweaver','light');--omnidb-- -INSERT INTO themes VALUES(7,'eclipse','light');--omnidb-- -INSERT INTO themes VALUES(8,'github','light');--omnidb-- -INSERT INTO themes VALUES(9,'iplastic','light');--omnidb-- -INSERT INTO themes VALUES(10,'katzenmilch','light');--omnidb-- -INSERT INTO themes VALUES(11,'kuroir','light');--omnidb-- -INSERT INTO themes VALUES(12,'solarized_light','light');--omnidb-- -INSERT INTO themes VALUES(13,'sqlserver','light');--omnidb-- -INSERT INTO themes VALUES(14,'textmate','light');--omnidb-- -INSERT INTO themes VALUES(15,'tomorrow','light');--omnidb-- -INSERT INTO themes VALUES(16,'xcode','light');--omnidb-- -INSERT INTO themes VALUES(17,'omnidb_dark','dark');--omnidb-- -INSERT INTO themes VALUES(18,'ambiance','dark');--omnidb-- -INSERT INTO themes VALUES(19,'chaos','dark');--omnidb-- -INSERT INTO themes VALUES(20,'clouds_midnight','dark');--omnidb-- -INSERT INTO themes VALUES(21,'cobalt','dark');--omnidb-- -INSERT INTO themes VALUES(22,'idle_fingers','dark');--omnidb-- -INSERT INTO themes VALUES(23,'kr_theme','dark');--omnidb-- -INSERT INTO themes VALUES(24,'merbivore','dark');--omnidb-- -INSERT INTO themes VALUES(25,'merbivore_soft','dark');--omnidb-- -INSERT INTO themes VALUES(26,'mono_industrial','dark');--omnidb-- -INSERT INTO themes VALUES(27,'monokai','dark');--omnidb-- -INSERT INTO themes VALUES(28,'pastel_on_dark','dark');--omnidb-- -INSERT INTO themes VALUES(29,'solarized_dark','dark');--omnidb-- -INSERT INTO themes VALUES(30,'terminal','dark');--omnidb-- -INSERT INTO themes VALUES(31,'tomorrow_night','dark');--omnidb-- -INSERT INTO themes VALUES(32,'tomorrow_night_blue','dark');--omnidb-- -INSERT INTO themes VALUES(33,'tomorrow_night_bright','dark');--omnidb-- -INSERT INTO themes VALUES(34,'tomorrow_night_eighties','dark');--omnidb-- -INSERT INTO themes VALUES(35,'twilight','dark');--omnidb-- -INSERT INTO themes VALUES(36,'vibrant_ink','dark');--omnidb-- - -CREATE TABLE users ( - user_id integer not null, - user_name varchar(30), - password varchar(100), - theme_id integer, - editor_font_size varchar(10), - chat_enabled integer, - super_user integer, - csv_encoding varchar(20), - csv_delimiter varchar(10), - interface_font_size text, - welcome_closed integer, - constraint pk_users primary key (user_id), - constraint users_fk_0 foreign key (theme_id) references themes (theme_id) on update NO ACTION on delete NO ACTION, - constraint uq_users_0 unique (user_name) -);--omnidb-- -INSERT INTO users VALUES(1,'admin','48b19163bdb02cadab1a09c9dd4eafae',1,'14',1,1,'utf-8',';','11',0);--omnidb-- - -CREATE TABLE messages ( - mes_in_code integer not null, - mes_st_text text, - mes_dt_timestamp text not null, - user_id integer not null, - mes_bo_image integer not null, - constraint pk_messages primary key (mes_in_code), - constraint messages_fk_0 foreign key (user_id) references users (user_id) on update NO ACTION on delete CASCADE -);--omnidb-- - -CREATE TABLE messages_users ( - mes_in_code integer not null, - user_id integer not null, - constraint pk_messages_users primary key (mes_in_code, user_id), - constraint messages_users_fk_0 foreign key (mes_in_code) references messages (mes_in_code) on update NO ACTION on delete CASCADE, - constraint messages_users_fk_1 foreign key (user_id) references users (user_id) on update NO ACTION on delete CASCADE -);--omnidb-- - -CREATE TABLE snippets_nodes ( - sn_id integer not null, - sn_name text,user_id integer not null, - sn_date_create text, - sn_date_modify text, - sn_id_parent integer, - constraint pk_snippets_nodes primary key (sn_id), - constraint fk_sn_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, - constraint fk_sn_sn foreign key (sn_id_parent) references snippets_nodes (sn_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE snippets_texts ( - st_id integer not null, - st_name text, - st_text text, - st_date_create text, - st_date_modify text, - sn_id_parent integer, - user_id integer not null, - constraint pk_snippets_texts primary key (st_id), - constraint fk_st_sn foreign key (sn_id_parent) references snippets_nodes (sn_id) on update CASCADE on delete CASCADE, - constraint fk_st_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE connections ( - conn_id integer, - user_id integer, - dbt_st_name varchar(40), - server varchar(500), - port varchar(20), - service varchar(500), - user varchar(100), - alias varchar(100), - ssh_server varchar(500), - ssh_port varchar(20), - ssh_user varchar(100), - ssh_password varchar(100), - ssh_key text, - use_tunnel integer, - conn_string text, - constraint pk_connections primary key (conn_id), - constraint connections_fk_0 foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, - constraint connections_fk_1 foreign key (dbt_st_name) references db_type (dbt_st_name) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE conversions ( - conv_id integer,conn_id_src integer, - conn_id_dst integer, - conv_st_start varchar(100), - conv_st_end varchar(100), - conv_re_perc real, - conv_ch_status char, - conv_st_comments varchar(500), - conv_st_duration varchar(100), - user_id integer,process_id integer, - constraint pk_conversions primary key (conv_id), - constraint conversions_fk_0 foreign key (conn_id_src) references connections (conn_id) on update CASCADE on delete CASCADE, - constraint conversions_fk_1 foreign key (conn_id_dst) references connections (conn_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE conv_tables_data ( - conv_id integer, - ctd_st_table text, - ctd_ch_droprecords char, - ctd_ch_createtable char, - ctd_ch_createpk char, - ctd_ch_createfk char, - ctd_ch_createuq char, - ctd_ch_createidx char, - ctd_ch_transferdata char, - ctd_in_totalrecords integer, - ctd_in_transfrecords integer, - ctd_re_transfperc real, - ctd_re_transferrate real, - ctd_st_starttransfer text, - ctd_st_endtransfer text, - ctd_st_duration text, - ctd_st_status_droprecords text, - ctd_st_status_createtable text, - ctd_st_status_createpk text, - ctd_st_status_createfk text, - ctd_st_status_createuq text, - ctd_st_status_createidx text, - ctd_st_status_transferdata text, - ctd_st_transferfilter text, - constraint pk_conv_tables_data primary key (conv_id, ctd_st_table), - constraint conv_tables_data_fk_0 foreign key (conv_id) references conversions (conv_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE command_list ( - user_id integer not null, - cl_in_codigo integer not null, - cl_st_command text, - cl_st_start text, - cl_st_end text, - cl_st_status text, - cl_st_duration text, - conn_id integer not null, - constraint pk_command_list primary key (cl_in_codigo), - constraint command_list_fk_0 foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, - constraint fk_cl_conn foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE tabs ( - conn_id integer not null, - user_id integer not null, - tab_id integer not null, - snippet text, - title text, - constraint fk_tabs_conn foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE, - constraint fk_tabs_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE mon_units ( - unit_id integer not null, - dbt_st_name text, - script_chart text, - script_data text, - type text, - title text, - is_default integer, - user_id integer, - interval integer, - constraint pk_mon_units primary key (unit_id), - constraint fk_mu_dbt foreign key (dbt_st_name) references db_type (dbt_st_name) on update NO ACTION on delete NO ACTION, - constraint fk_mu_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE -);--omnidb-- -INSERT INTO mon_units VALUES(1,'postgresql',replace('max_connections = connection.ExecuteScalar(''SHOW max_connections'')\n\nresult = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Backends (max_connections: " + str(max_connections) + ")"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Value"\n },\n "ticks": {\n "beginAtZero": True,\n "max": int(max_connections)\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT d.datname,\n s.numbackends\n FROM pg_stat_database s\n INNER JOIN pg_database d\n ON d.oid = s.datid\n WHERE NOT d.datistemplate\n'''''')\n\ndatasets = []\nfor db in databases.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": db[''datname''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [db["numbackends"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Backends',1,NULL,5);--omnidb-- -INSERT INTO mon_units VALUES(2,'postgresql',replace('total_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Database Size (Total: " + str(total_size) + " MB)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT datname AS datname,\n round(pg_catalog.pg_database_size(datname)/1048576.0,2) AS size\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n ORDER BY\n CASE WHEN pg_catalog.has_database_privilege(datname, ''CONNECT'')\n THEN pg_catalog.pg_database_size(datname)\n ELSE NULL\n END DESC\n'''''')\n\ndatasets = []\nfor db in databases.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": db[''datname''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [db["size"]]\n })\n\ntotal_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets,\n "title": "Database Size (Total: " + str(total_size) + " MB)"\n}\n','\n',char(10)),'chart_append','Database Size',1,NULL,30);--omnidb-- -INSERT INTO mon_units VALUES(3,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Size: Top 5 Tables"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntables = connection.Query(''''''\n SELECT nspname || ''.'' || relname AS relation,\n round(pg_relation_size(c.oid)/1048576.0,2) AS size\n FROM pg_class c\n LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)\n WHERE nspname NOT IN (''pg_catalog'', ''information_schema'')\n AND c.relkind <> ''i''\n AND nspname !~ ''^pg_toast''\n ORDER BY pg_total_relation_size(c.oid) DESC\n LIMIT 5\n'''''')\n\ndatasets = []\nfor table in tables.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": table[''relation''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [table["size"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Size: Top 5 Tables',0,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(4,'postgresql','',replace('from datetime import datetime\n\ndata = connection.Query(''''''\n SELECT *\n FROM pg_stat_activity\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}\n','\n',char(10)),'grid','Activity',0,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(5,'postgresql','',replace('from datetime import datetime\n\ndata = connection.Query(''''''\n SELECT z.current_database,z.schemaname,z.tablename, pg_size_pretty(sum_wasted) AS total_bloat\n FROM (\n SELECT y.schemaname, y.tablename, y.current_database, sum(wastedbytes+wastedibytes)::bigint AS sum_wasted\n FROM (\n SELECT current_database,schemaname, tablename, tbloat, wastedbytes, iname, ibloat, wastedibytes AS wastedibytes\n FROM (\n SELECT\n current_database(), schemaname, tablename, /*reltuples::bigint, relpages::bigint, otta,*/\n ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat,\n CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::BIGINT END AS wastedbytes,\n iname, /*ituples::bigint, ipages::bigint, iotta,*/\n ROUND((CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages::FLOAT/iotta END)::NUMERIC,1) AS ibloat,\n CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes\n FROM (\n SELECT\n schemaname, tablename, cc.reltuples, cc.relpages, bs,\n CEIL((cc.reltuples*((datahdr+ma-\n (CASE WHEN datahdr%ma=0 THEN ma ELSE datahdr%ma END))+nullhdr2+4))/(bs-20::FLOAT)) AS otta,\n COALESCE(c2.relname,''?'') AS iname, COALESCE(c2.reltuples,0) AS ituples, COALESCE(c2.relpages,0) AS ipages,\n COALESCE(CEIL((c2.reltuples*(datahdr-12))/(bs-20::FLOAT)),0) AS iotta -- very rough approximation, assumes all cols\n FROM (\n SELECT\n ma,bs,schemaname,tablename,\n (datawidth+(hdr+ma-(CASE WHEN hdr%ma=0 THEN ma ELSE hdr%ma END)))::NUMERIC AS datahdr,\n (maxfracsum*(nullhdr+ma-(CASE WHEN nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2\n FROM (\n SELECT\n schemaname, tablename, hdr, ma, bs,\n SUM((1-null_frac)*avg_width) AS datawidth,\n MAX(null_frac) AS maxfracsum,\n hdr+(\n SELECT 1+COUNT(*)/8\n FROM pg_stats s2\n WHERE null_frac<>0 AND s2.schemaname = s.schemaname AND s2.tablename = s.tablename\n ) AS nullhdr\n FROM pg_stats s, (\n SELECT\n (SELECT current_setting(''block_size'')::NUMERIC) AS bs,\n CASE WHEN SUBSTRING(v,12,3) IN (''8.0'',''8.1'',''8.2'') THEN 27 ELSE 23 END AS hdr,\n CASE WHEN v ~ ''mingw32'' THEN 8 ELSE 4 END AS ma\n FROM (SELECT version() AS v) AS foo\n ) AS constants\n GROUP BY 1,2,3,4,5\n ) AS foo\n ) AS rs\n JOIN pg_class cc ON cc.relname = rs.tablename\n JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> ''information_schema''\n LEFT JOIN pg_index i ON indrelid = cc.oid\n LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid\n ) AS sml) x) y\n GROUP BY y.schemaname, y.tablename, y.current_database) z\n ORDER BY z.sum_wasted DESC\n LIMIT 20\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}','\n',char(10)),'grid','Bloat: Top 20 Tables',0,NULL,30);--omnidb-- -INSERT INTO mon_units VALUES(6,'postgresql',replace('max_connections = connection.ExecuteScalar(''SHOW max_connections'')\n\nresult = {\n "type": "pie",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Backends (max_connections: " + str(max_connections) + ")"\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT d.datname,\n s.numbackends\n FROM pg_stat_database s\n INNER JOIN pg_database d\n ON d.oid = s.datid\n WHERE NOT d.datistemplate\n'''''')\n\ndata = []\ncolor = []\nlabel = []\n\nfor db in databases.Rows:\n data.append(db["numbackends"])\n color.append("rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")")\n label.append(db["datname"])\n\nresult = {\n "labels": label,\n "datasets": [\n {\n "data": data,\n "backgroundColor": color,\n "label": "Dataset 1"\n }\n ]\n}\n','\n',char(10)),'chart','Backends',1,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(7,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"CPU Usage"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Value",\n },\n "ticks": {\n "beginAtZero": True,\n "max": 100\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntry:\n cpu_data = connection.Query(''''''\n create temporary table tabela (c1 text);\n copy tabela from program ''mpstat -P ALL 1 1 | grep "Average:" | tail -n +2 | tr -s " " | cut -f2,3 -d" "'';\n select * from tabela;\n '''''')\nexcept:\n raise Exception(''This chart can not be executed in a standby server.'')\n\nif len(cpu_data.Rows) == 0:\n raise Exception(''This chart can only be executed in a Linux server.'')\n\ndatasets = []\nfor cpu in cpu_data.Rows:\n if cpu!='''':\n cpu_split = cpu[0].split('' '')\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": cpu_split[0],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [cpu_split[1]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','CPU Usage',0,NULL,10);--omnidb-- -INSERT INTO mon_units VALUES(8,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Locks"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Num locks"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nlocks = connection.Query(''''''\n SELECT mode,\n count(*) as count\n FROM pg_locks\n GROUP BY mode\n'''''')\n\ndatasets = []\nfor lock in locks.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": lock[''mode''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [lock["count"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Locks',1,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(9,'postgresql','',replace('data = connection.Query(''''''\n SELECT pg_is_in_recovery() as "In Recovery"\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}','\n',char(10)),'grid','In Recovery',0,NULL,120);--omnidb-- -INSERT INTO mon_units VALUES(10,'postgresql',replace('total_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "type": "pie",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Database Size (Total: " + str(total_size) + " MB)"\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT d.datname AS datname,\n round(pg_catalog.pg_database_size(d.datname)/1048576.0,2) AS size\n FROM pg_catalog.pg_database d\n WHERE d.datname not in (''template0'',''template1'')\n'''''')\n\ndata = []\ncolor = []\nlabel = []\n\nfor db in databases.Rows:\n data.append(db["size"])\n color.append("rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")")\n label.append(db["datname"])\n\ntotal_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "labels": label,\n "datasets": [\n {\n "data": data,\n "backgroundColor": color,\n "label": "Dataset 1"\n }\n ],\n "title": "Database Size (Total: " + str(total_size) + " MB)"\n}\n','\n',char(10)),'chart','Database Size',1,NULL,30);--omnidb-- -INSERT INTO mon_units VALUES(11,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Bloat: Top 5 Tables"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntables = connection.Query(''''''\n SELECT z.schemaname || ''.'' || z.tablename as relation, sum_wasted/1048576.0 AS size\n FROM (\n SELECT y.schemaname, y.tablename, y.current_database, wastedbytes + sum(wastedibytes)::bigint AS sum_wasted\n FROM (\n SELECT current_database,schemaname, tablename, tbloat, wastedbytes, iname, ibloat, wastedibytes AS wastedibytes\n FROM (\n SELECT\n current_database(), schemaname, tablename, /*reltuples::bigint, relpages::bigint, otta,*/\n ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat,\n CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::BIGINT END AS wastedbytes,\n iname, /*ituples::bigint, ipages::bigint, iotta,*/\n ROUND((CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages::FLOAT/iotta END)::NUMERIC,1) AS ibloat,\n CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes\n FROM (\n SELECT\n schemaname, tablename, cc.reltuples, cc.relpages, bs,\n CEIL((cc.reltuples*((datahdr+ma-\n (CASE WHEN datahdr%ma=0 THEN ma ELSE datahdr%ma END))+nullhdr2+4))/(bs-20::FLOAT)) AS otta,\n COALESCE(c2.relname,''?'') AS iname, COALESCE(c2.reltuples,0) AS ituples, COALESCE(c2.relpages,0) AS ipages,\n COALESCE(CEIL((c2.reltuples*(datahdr-12))/(bs-20::FLOAT)),0) AS iotta -- very rough approximation, assumes all cols\n FROM (\n SELECT\n ma,bs,schemaname,tablename,\n (datawidth+(hdr+ma-(CASE WHEN hdr%ma=0 THEN ma ELSE hdr%ma END)))::NUMERIC AS datahdr,\n (maxfracsum*(nullhdr+ma-(CASE WHEN nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2\n FROM (\n SELECT\n schemaname, tablename, hdr, ma, bs,\n SUM((1-null_frac)*avg_width) AS datawidth,\n MAX(null_frac) AS maxfracsum,\n hdr+(\n SELECT 1+COUNT(*)/8\n FROM pg_stats s2\n WHERE null_frac<>0 AND s2.schemaname = s.schemaname AND s2.tablename = s.tablename\n ) AS nullhdr\n FROM pg_stats s, (\n SELECT\n (SELECT current_setting(''block_size'')::NUMERIC) AS bs,\n CASE WHEN SUBSTRING(v,12,3) IN (''8.0'',''8.1'',''8.2'') THEN 27 ELSE 23 END AS hdr,\n CASE WHEN v ~ ''mingw32'' THEN 8 ELSE 4 END AS ma\n FROM (SELECT version() AS v) AS foo\n ) AS constants\n GROUP BY 1,2,3,4,5\n ) AS foo\n ) AS rs\n JOIN pg_class cc ON cc.relname = rs.tablename\n JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> ''information_schema''\n LEFT JOIN pg_index i ON indrelid = cc.oid\n LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid\n ) AS sml) x) y\n GROUP BY y.schemaname, y.tablename, y.current_database, y.wastedbytes) z\n ORDER BY z.sum_wasted DESC\n LIMIT 5\n'''''')\n\ndatasets = []\nfor table in tables.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": table[''relation''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [table["size"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Bloat: Top 5 Tables',0,NULL,45);--omnidb-- -INSERT INTO mon_units VALUES(12,'postgresql','',replace('from datetime import datetime\n\ndata = connection.Query(''''''\n SELECT relname as table_name,\n pg_size_pretty(pg_table_size(oid)) as table_size,\n age(relfrozenxid) as xid_age,\n current_setting(''autovacuum_freeze_max_age'')::integer as max_age,\n round(age(relfrozenxid)/(current_setting(''autovacuum_freeze_max_age'')::integer)::numeric*100.0,4) as perc\n FROM pg_class\n WHERE relkind in (''r'', ''t'')\n ORDER BY age(relfrozenxid) DESC\n LIMIT 20;\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}\n','\n',char(10)),'grid','AutovacFreeze: Top 20 Tables',0,NULL,60);--omnidb-- -INSERT INTO mon_units VALUES(13,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Master: Replication Lag"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nreplags = connection.Query(''''''\n CREATE TEMPORARY TABLE omnidb_monitor_result (result1 TEXT, result2 TEXT);\n DO $$\n BEGIN\n IF current_setting(''server_version_num'')::integer < 100000 THEN\n EXECUTE ''INSERT INTO omnidb_monitor_result SELECT client_addr || ''''-'''' || application_name as standby,''\n ''round(pg_xlog_location_diff(pg_current_xlog_location(),replay_location)/1048576.0,2) as lag ''\n ''FROM pg_stat_replication'';\n ELSE\n EXECUTE ''INSERT INTO omnidb_monitor_result SELECT client_addr || ''''-'''' || application_name as standby,''\n ''round(pg_wal_lsn_diff(pg_current_wal_lsn(),replay_lsn)/1048576.0,2) as lag ''\n ''FROM pg_stat_replication'';\n END IF;\n END$$;\n SELECT result1 as standby, result2 as lag FROM omnidb_monitor_result;\n'''''')\n\ndatasets = []\nfor replag in replags.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": replag[''standby''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [replag[''lag'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Master: Replication Lag',0,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(14,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Standby: Replication Lag (Size)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nreplags = connection.Query(''''''\n CREATE TEMPORARY TABLE omnidb_monitor_result (result TEXT);\n DO $$DECLARE r record;\n BEGIN\n IF current_setting(''server_version_num'')::integer < 100000 THEN\n EXECUTE ''INSERT INTO omnidb_monitor_result ''\n ''SELECT round(pg_xlog_location_diff(pg_last_xlog_receive_location(), pg_last_xlog_replay_location())/1048576.0,2) AS lag'';\n ELSE\n EXECUTE ''INSERT INTO omnidb_monitor_result ''\n ''SELECT round(pg_wal_lsn_diff(pg_last_wal_receive_lsn(), pg_last_wal_replay_lsn())/1048576.0,2) AS lag'';\n END IF;\n END$$;\n SELECT result as lag FROM omnidb_monitor_result;\n'''''')\n\ndatasets = []\nfor replag in replags.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": "Lag",\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [replag[''lag'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Standby: Replication Lag (Size)',0,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(15,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Standby: Replication Lag (Time)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Seconds"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nreplags = connection.Query(''''''\n SELECT COALESCE(ROUND(EXTRACT(epoch FROM now() - pg_last_xact_replay_timestamp())),0) AS lag\n'''''')\n\ndatasets = []\nfor replag in replags.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": "Lag",\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [replag[''lag'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Standby: Replication Lag (Time)',0,NULL,15);--omnidb-- -INSERT INTO mon_units VALUES(16,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"System Memory Usage (Total: " + total_mem + "MB)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "%",\n },\n "ticks": {\n "beginAtZero": True,\n "max": 100\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntry:\n mem_data = connection.ExecuteScalar(''''''\n create temporary table tabela (c1 text);\n copy tabela from program ''free -m | tail -n +2 | head -n 1 | tr -s " " | cut -f2,3,4 -d " "'';\n select * from tabela;\n '''''')\nexcept:\n raise Exception(''This chart can not be executed in a standby server.'')\n\nif mem_data is None:\n raise Exception(''This chart can only be executed in a Linux server.'')\n\ndatasets = []\nmem_split = mem_data.split('' '')\ntotal_mem = mem_split[0]\nused_mem = mem_split[1]\nfree_mem = mem_split[2]\nperc_mem = round(int(used_mem)*100/int(total_mem),2)\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": "Memory",\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [perc_mem]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Memory Usage',0,NULL,10);--omnidb-- -INSERT INTO mon_units VALUES(17,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":True,\n "text":"Longest Active Query"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Duration(s)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nduration = connection.ExecuteScalar(''''''\n SELECT duration FROM\n (SELECT EXTRACT(EPOCH FROM(now() - query_start))::INTEGER AS duration FROM pg_stat_activity WHERE state=''active''\n UNION ALL\n SELECT 0) t\n WHERE duration is NOT NULL\n ORDER BY duration DESC\n LIMIT 1\n'''''')\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''Query'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [duration]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Longest Active Query',0,NULL,5);--omnidb-- -INSERT INTO mon_units VALUES(18,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":True,\n "text":"WAL Folder Size"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size(MB)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nsize = connection.ExecuteScalar(''''''\n CREATE TEMPORARY TABLE omnidb_temp (c1 TEXT, c2 TEXT);\n COPY omnidb_temp FROM PROGRAM ''du -s pg_xlog || du -s pg_wal'';\n SELECT ROUND(c1::BIGINT/1048576.0,2) AS pg_xlog_size FROM omnidb_temp;\n'''''')\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''WAL Folder Size'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [size]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','WAL Folder Size',0,NULL,30);--omnidb-- -INSERT INTO mon_units VALUES(19,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":False\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": False,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "MB/s"\n },\n "ticks": {\n "beginAtZero": True,\n "suggestedMax": 1\n }\n }]\n }\n }\n}','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntry:\n if previous_data != None:\n query = "select round(pg_wal_lsn_diff(pg_current_wal_lsn(),''" + previous_data["current_lsn"] + "'')/(1048576*extract(epoch from now()::time - ''" + previous_data["current_time"] + "''::time))::numeric,2) as wal_rate, pg_current_wal_lsn() as current_lsn, now()::time as current_time"\n else:\n query = ''select 0 as wal_rate, pg_current_wal_lsn() as current_lsn, now()::time as current_time''\n query_data = connection.Query(query)\nexcept:\n if previous_data != None:\n query = "select round(pg_xlog_location_diff(pg_current_xlog_location(),''" + previous_data["current_lsn"] + "'')/(1048576*extract(epoch from now()::time - ''" + previous_data["current_time"] + "''::time))::numeric,2) as wal_rate, pg_current_xlog_location() as current_lsn, now()::time as current_time"\n else:\n query = ''select 0 as wal_rate, pg_current_xlog_location() as current_lsn, now()::time as current_time''\n query_data = connection.Query(query)\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''Rate'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [query_data.Rows[0][''wal_rate'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets,\n "current_lsn": query_data.Rows[0][''current_lsn''],\n ''current_time'': query_data.Rows[0][''current_time'']\n}','\n',char(10)),'chart_append','WAL Production Rate',0,NULL,10);--omnidb-- -INSERT INTO mon_units VALUES(20,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":False\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": False,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": False\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nif previous_data != None:\n query = "select round((sum(xact_commit+xact_rollback) - " + previous_data["current_count"] + ")/(extract(epoch from now()::time - ''" + previous_data["current_time"] + "''::time))::numeric,2) as tps, sum(xact_commit+xact_rollback) as current_count, now()::time as current_time FROM pg_stat_database"\nelse:\n query = ''select 0 as tps, sum(xact_commit+xact_rollback) as current_count, now()::time as current_time FROM pg_stat_database''\n\nquery_data = connection.Query(query)\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''Rate'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 0,\n "borderWidth": 1,\n "data": [query_data.Rows[0][''tps'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets,\n "current_count": query_data.Rows[0][''current_count''],\n ''current_time'': query_data.Rows[0][''current_time'']\n}','\n',char(10)),'chart_append','TPS',1,NULL,10);--omnidb-- -INSERT INTO mon_units VALUES(21,'postgresql',replace('from random import randint\n\nresult = {\n "container": None,\n "boxSelectionEnabled": False,\n "autounselectify": True,\n "layout": {\n "name": "spread",\n "minDist": 1000\n },\n "style": [\n {\n "selector": "node",\n "style": {\n "content": "data(label)",\n "text-opacity": 1,\n "text-valign": "top",\n "text-halign": "right",\n "text-wrap": "wrap",\n "color": "gray",\n "text-rotation": "autorotate",\n "font-size": 12\n }\n },\n {\n "selector": "node.node_local",\n "style": {\n "background-color": "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")",\n "shape": ''square''\n }\n },\n {\n "selector": "node.node_remote",\n "style": {\n "background-color": "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")",\n }\n },\n {\n "selector": "edge",\n "style": {\n "curve-style": "bezier",\n "control-point-step-size": 40,\n "target-arrow-shape": "triangle",\n "text-opacity": 1,\n "width": 2,\n "control-point-distances": 50,\n "content": "data(label)",\n "text-wrap": "wrap",\n "line-style": "solid",\n "width": 1,\n "color": "gray",\n "text-outline-color": ''gray'',\n "text-outline-width": 0\n }\n }\n ],\n "elements": {\n "nodes": None,\n "edges": None\n }\n}','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nnodes = []\nedges = []\n\ntry:\n repl_nodes = connection.Query(''''''\n select application_name,\n pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(),coalesce(replay_lsn,flush_lsn))) lag_size\n from pg_stat_replication\n '''''')\nexcept:\n repl_nodes = connection.Query(''''''\n select application_name,\n pg_size_pretty(pg_xlog_location_diff(pg_current_xlog_location(),coalesce(replay_location,flush_location)) lag_size\n from pg_stat_replication\n '''''')\n\nif len(repl_nodes.Rows) == 0:\n raise Exception(''There are no nodes replicating from this instance.'')\n\nnodes.append({\n "data": {\n "id": ''local'',\n "label": ''local'',\n },\n "classes": ''node_local''\n })\n\nfor repl_node in repl_nodes.Rows:\n nodes.append({\n "data": {\n "id": ''node_'' + repl_node[''application_name''],\n "label": repl_node[''application_name'']\n },\n "classes": ''node_remote''\n })\n edges.append({\n "data": {\n "id": ''edge_'' + repl_node[''application_name''],\n "label": repl_node[''lag_size''],\n "source": ''local'',\n "target": ''node_'' + repl_node[''application_name'']\n }\n })\n\nresult = {\n "nodes": nodes,\n "edges": edges\n}','\n',char(10)),'graph','Replication',0,NULL,10);--omnidb-- - -CREATE TABLE units_users_connections ( - uuc_id integer not null, - unit_id integer not null, - user_id integer not null, - conn_id integer not null, - interval integer not null, - plugin_name text, - constraint pk_units_users_connections primary key (uuc_id), - constraint units_users_connections_fk_0 foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE, - constraint units_users_connections_fk_1 foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE shortcuts ( - user_id integer, - shortcut_code text, - ctrl_pressed integer, - shift_pressed integer, - alt_pressed integer, - meta_pressed integer, - shortcut_key text, - constraint pk_shortcuts primary key (user_id, shortcut_code), - constraint fk_shortcuts_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE -);--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_analyze',0,0,1,0,'S');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_explain',0,0,1,0,'A');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_indent',0,0,1,0,'D');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_left_inner_tab',1,0,0,0,',');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_left_outer_tab',0,0,1,0,',');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_new_inner_tab',1,0,0,0,'INSERT');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_new_outer_tab',0,0,1,0,'INSERT');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_remove_inner_tab',1,0,0,0,'END');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_remove_outer_tab',0,0,1,0,'END');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_right_inner_tab',1,0,0,0,'.');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_run_query',0,0,1,0,'Q');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_right_outer_tab',0,0,1,0,'.');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_cancel_query',0,0,1,0,'C');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_next_console_command',1,0,0,0,'ARROWDOWN');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_previous_console_command',1,0,0,0,'ARROWUP');--omnidb-- -INSERT INTO shortcuts VALUES(NULL,'shortcut_autocomplete',1,0,0,0,'SPACE');--omnidb-- - -CREATE TABLE console_history ( - user_id integer, - conn_id integer, - command_text text, - command_date text, - constraint fk_ch_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, - constraint fk_ch_conn foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE -);--omnidb-- - -CREATE TABLE cgroups ( - cgroup_id integer primary key, - user_id integer references users (user_id) ON UPDATE CASCADE ON DELETE CASCADE, - cgroup_name text -);--omnidb-- - -CREATE TABLE cgroups_connections ( - cgroup_id integer references cgroups (cgroup_id) ON UPDATE CASCADE ON DELETE CASCADE, - conn_id integer references connections (conn_id) ON UPDATE CASCADE ON DELETE CASCADE, - primary key (cgroup_id, conn_id) -);--omnidb-- - -CREATE TABLE version ( - ver_id text not null, - constraint pk_versions primary key (ver_id) -);--omnidb-- -INSERT INTO version VALUES('2.16.0');--omnidb-- diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.17.0.sql omnidb-2.17.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.17.0.sql --- omnidb-2.16.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.17.0.sql 1970-01-01 00:00:00.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB/migrations/omnidb_0.0.0_2.17.0.sql 2019-12-05 15:30:40.000000000 +0000 @@ -0,0 +1,634 @@ +CREATE TABLE db_type ( + dbt_st_name varchar(40), + dbt_in_enabled integer, + constraint pk_db_type primary key (dbt_st_name) +);--omnidb-- +INSERT INTO db_type VALUES('sqlite',0);--omnidb-- +INSERT INTO db_type VALUES('mysql',1);--omnidb-- +INSERT INTO db_type VALUES('postgresql',1);--omnidb-- +INSERT INTO db_type VALUES('firebird',0);--omnidb-- +INSERT INTO db_type VALUES('oracle',1);--omnidb-- +INSERT INTO db_type VALUES('sqlserver',0);--omnidb-- +INSERT INTO db_type VALUES('access',0);--omnidb-- +INSERT INTO db_type VALUES('sqlce',0);--omnidb-- +INSERT INTO db_type VALUES('mariadb',1);--omnidb-- +INSERT INTO db_type VALUES('filedb',0);--omnidb-- +INSERT INTO db_type VALUES('terminal',1);--omnidb-- + +CREATE TABLE data_categories ( + cat_st_name varchar(40), + cat_st_description varchar(100), + cat_st_class varchar(40), + constraint pk_data_categories primary key (cat_st_name) +);--omnidb-- +INSERT INTO data_categories VALUES('bigint','Big Integer','numeric');--omnidb-- +INSERT INTO data_categories VALUES('boolean','Boolean','other');--omnidb-- +INSERT INTO data_categories VALUES('char','String','text');--omnidb-- +INSERT INTO data_categories VALUES('date','Date Only','other');--omnidb-- +INSERT INTO data_categories VALUES('datetime','Date Time','other');--omnidb-- +INSERT INTO data_categories VALUES('decimal','Decimal','numeric');--omnidb-- +INSERT INTO data_categories VALUES('fp','Floating Point','numeric');--omnidb-- +INSERT INTO data_categories VALUES('integer','Integer','numeric');--omnidb-- +INSERT INTO data_categories VALUES('smallint','Small Integer','numeric');--omnidb-- +INSERT INTO data_categories VALUES('text','Long String','text');--omnidb-- +INSERT INTO data_categories VALUES('time','Time Only','other');--omnidb-- +INSERT INTO data_categories VALUES('varchar','Var String','text');--omnidb-- + +CREATE TABLE data_types ( + cat_st_name varchar(40), + dbt_st_name varchar(40), + dt_type varchar(100), + dt_in_sufix integer, + dt_st_writeformat varchar(1000), + dt_st_readformat varchar(1000), + dt_st_compareformat varchar(1000), + constraint pk_data_types primary key (dbt_st_name, dt_type), + constraint data_types_fk_0 foreign key (cat_st_name) references data_categories (cat_st_name), + constraint data_types_fk_1 foreign key (dbt_st_name) references db_type (dbt_st_name) +);--omnidb-- +INSERT INTO data_types VALUES('text','access','binary',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('boolean','access','boolean',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','access','byte',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','access','complex_type',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','access','double',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','access','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','access','guid',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','access','int',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','access','long',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','access','memo',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','access','money',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','access','numeric',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','access','ole',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('datetime','access','short_date_time',0,'''#''','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'') as #','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'')');--omnidb-- +INSERT INTO data_types VALUES('text','access','text',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','firebird','bigint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','firebird','char',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('date','firebird','date',0,'cast(''#'' as date)',replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'') as #','\n',char(10)),replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'')','\n',char(10)));--omnidb-- +INSERT INTO data_types VALUES('decimal','firebird','decimal',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','firebird','double',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','firebird','double precision',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','firebird','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','firebird','int',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','firebird','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','firebird','nchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','firebird','ntext',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','firebird','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','firebird','nvarchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','firebird','real',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','firebird','smallint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','firebird','BLOB SUB_TYPE TEXT',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('time','firebird','time',0,'cast(''#'' as time)',replace('lpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'') as #','\n',char(10)),replace('lpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'')','\n',char(10)));--omnidb-- +INSERT INTO data_types VALUES('datetime','firebird','timestamp',0,'cast(''#'' as timestamp)',replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '' '' ||\nlpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'') as #','\n',char(10)),replace('lpad(cast(extract(year from cast(# as timestamp)) as varchar(4)), 4, ''0'') || ''-'' ||\nlpad(cast(extract(month from cast(# as timestamp)) as varchar(2)), 2, ''0'') || ''-'' ||\nlpad(cast(extract(day from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '' '' ||\nlpad(cast(extract(hour from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(extract(minute from cast(# as timestamp)) as varchar(2)), 2, ''0'') || '':'' ||\nlpad(cast(round(extract(second from cast(# as timestamp))) as varchar(2)), 2, ''0'')','\n',char(10)));--omnidb-- +INSERT INTO data_types VALUES('smallint','firebird','tinyint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','firebird','varchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','mysql','bigint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','mysql','bit',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('boolean','mysql','boolean',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','mysql','char',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('date','mysql','date',0,'STR_TO_DATE(''#'', ''%Y-%m-%d'')','DATE_FORMAT(#, ''%Y-%m-%d'') as #','DATE_FORMAT(#, ''%Y-%m-%d'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','mysql','datetime',0,'STR_TO_DATE(''#'', ''%Y-%m-%d %H:%i:%s'')','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'') as #','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'')');--omnidb-- +INSERT INTO data_types VALUES('decimal','mysql','decimal',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','mysql','double',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','mysql','double precision',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','mysql','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','mysql','int',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','mysql','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','mysql','mediumint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','mysql','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','mysql','smallint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','mysql','text',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','mysql','tinyint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','mysql','varchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','oracle','binary_double',0,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('fp','oracle','binary_float',0,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('char','oracle','char',1,'''#''','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','date',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('fp','oracle','double',0,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('fp','oracle','float',0,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','oracle','integer',0,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('char','oracle','nchar',1,'''#''','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','oracle','number',2,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','oracle','numeric',2,'#','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','oracle','nvarchar2',1,'''#''','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(0)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(1)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(2)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(3)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(4)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(5)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(6)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(7)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(8)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','oracle','timestamp(9)',0,'to_date(''#'', ''yyyy-mm-dd HH24:MI:SS'')','to_char(#,''YYYY-MM-DD HH24:MI:SS'') as #','to_char(#,''YYYY-MM-DD HH24:MI:SS'')');--omnidb-- +INSERT INTO data_types VALUES('varchar','oracle','varchar',1,'''#''','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','oracle','varchar2',1,'''#''','to_char(#) as #','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','postgresql','bigint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','postgresql','bigserial',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('boolean','postgresql','boolean',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','postgresql','char',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','postgresql','character',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','postgresql','character varying',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('date','postgresql','date',0,'''#''','to_char(#::date, ''YYYY-mm-dd'') as #','to_char(#::date, ''YYYY-mm-dd'')');--omnidb-- +INSERT INTO data_types VALUES('decimal','postgresql','decimal',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','postgresql','double precision',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','postgresql','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','postgresql','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','postgresql','money',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','postgresql','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','postgresql','real',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','postgresql','serial',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','postgresql','smallint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','postgresql','smallserial',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','postgresql','text',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('time','postgresql','time with time zone',0,'''#''','to_char(#::time, ''hh24:mi:ss'') as #','to_char(#::time, ''hh24:mi:ss'')');--omnidb-- +INSERT INTO data_types VALUES('time','postgresql','time without time zone',0,'''#''','to_char(#::time, ''hh24:mi:ss'') as #','to_char(#::time, ''hh24:mi:ss'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','postgresql','timestamp with time zone',0,'''#''','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'') as #','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','postgresql','timestamp without time zone',0,'''#''','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'') as #','to_char(#::timestamp, ''YYYY-mm-dd hh24:mi:ss'')');--omnidb-- +INSERT INTO data_types VALUES('varchar','postgresql','varchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','sqlite','char',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','sqlite','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','sqlite','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','sqlite','nvarchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlite','real',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','sqlite','varchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','sqlserver','bigint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlserver','binary',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlserver','bit',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','sqlserver','char',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('date','sqlserver','date',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('datetime','sqlserver','datetime',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('datetime','sqlserver','datetime2',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('datetime','sqlserver','datetimeoffset',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('decimal','sqlserver','decimal',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlserver','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlserver','image',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','sqlserver','int',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlserver','money',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','sqlserver','nchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlserver','ntext',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','sqlserver','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','sqlserver','nvarchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlserver','real',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('datetime','sqlserver','smalldatetime',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('smallint','sqlserver','smallint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlserver','smallmoney',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlserver','text',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('time','sqlserver','time',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('datetime','sqlserver','timestamp',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('smallint','sqlserver','tinyint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlserver','varbinary',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','sqlserver','varchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','sqlserver','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','oracle','clob',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlite','text',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('datetime','access','datetime',0,'''#''','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'') as #','format(Nz(CStr(#),''''),''yyyy-MM-dd H:nn:ss'')');--omnidb-- +INSERT INTO data_types VALUES('time','mysql','time',0,'STR_TO_DATE(''#'', ''%H:%i:%s'')','DATE_FORMAT(#, ''%H:%i:%s'') as #','DATE_FORMAT(#, ''%H:%i:%s'')');--omnidb-- +INSERT INTO data_types VALUES('bigint','sqlce','bigint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlce','binary',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlce','bit',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('datetime','sqlce','datetime',0,'CONVERT(datetime, ''#'', 101)','CONVERT(varchar,#,120) as #','CONVERT(varchar,#,120)');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlce','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlce','image',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','sqlce','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlce','money',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlce','ntext',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','sqlce','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','sqlce','real',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','sqlce','smallint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','sqlce','tinyint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','sqlce','varbinary',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('bigint','mariadb','bigint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','mariadb','bit',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('boolean','mariadb','boolean',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('char','mariadb','char',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('date','mariadb','date',0,'STR_TO_DATE(''#'', ''%Y-%m-%d'')','DATE_FORMAT(#, ''%Y-%m-%d'') as #','DATE_FORMAT(#, ''%Y-%m-%d'')');--omnidb-- +INSERT INTO data_types VALUES('datetime','mariadb','datetime',0,'STR_TO_DATE(''#'', ''%Y-%m-%d %H:%i:%s'')','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'') as #','DATE_FORMAT(#, ''%Y-%m-%d %H:%i:%s'')');--omnidb-- +INSERT INTO data_types VALUES('decimal','mariadb','decimal',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','mariadb','double',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','mariadb','double precision',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('fp','mariadb','float',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','mariadb','int',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','mariadb','integer',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('integer','mariadb','mediumint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('decimal','mariadb','numeric',2,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('smallint','mariadb','smallint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('text','mariadb','text',0,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('time','mariadb','time',0,'STR_TO_DATE(''#'', ''%H:%i:%s'')','DATE_FORMAT(#, ''%H:%i:%s'') as #','DATE_FORMAT(#, ''%H:%i:%s'')');--omnidb-- +INSERT INTO data_types VALUES('smallint','mariadb','tinyint',0,'#','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','mariadb','varchar',1,'''#''','#','#');--omnidb-- +INSERT INTO data_types VALUES('varchar','filedb','varchar',0,'''#''','#','#');--omnidb-- + +CREATE TABLE representatives ( + cat_st_name varchar(40), + dbt_st_name varchar(40), + rep_st_default varchar(100), + dt_type varchar(100), + constraint pk_rep primary key (cat_st_name, dbt_st_name), + constraint fk_rep_dc foreign key (cat_st_name) references data_categories (cat_st_name), + constraint fk_rep_dbt foreign key (dbt_st_name) references db_type (dbt_st_name), + constraint fk_rep_dt foreign key (dbt_st_name, dt_type) references data_types (dbt_st_name, dt_type) +);--omnidb-- +INSERT INTO representatives VALUES('smallint','oracle','number(5,0)','number');--omnidb-- +INSERT INTO representatives VALUES('integer','oracle','number(10,0)','number');--omnidb-- +INSERT INTO representatives VALUES('bigint','oracle','number(19,0)','number');--omnidb-- +INSERT INTO representatives VALUES('decimal','oracle','number(38,0)','number');--omnidb-- +INSERT INTO representatives VALUES('fp','oracle','number(38,4)','number');--omnidb-- +INSERT INTO representatives VALUES('boolean','oracle','char(1)','char');--omnidb-- +INSERT INTO representatives VALUES('varchar','oracle','varchar2(1000)','varchar2');--omnidb-- +INSERT INTO representatives VALUES('boolean','postgresql','boolean','boolean');--omnidb-- +INSERT INTO representatives VALUES('smallint','postgresql','smallint','smallint');--omnidb-- +INSERT INTO representatives VALUES('integer','postgresql','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('bigint','postgresql','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('decimal','postgresql','numeric','numeric');--omnidb-- +INSERT INTO representatives VALUES('fp','postgresql','double precision','double precision');--omnidb-- +INSERT INTO representatives VALUES('fp','mysql','double precision','double precision');--omnidb-- +INSERT INTO representatives VALUES('smallint','mysql','smallint','smallint');--omnidb-- +INSERT INTO representatives VALUES('integer','mysql','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('bigint','mysql','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('varchar','mysql','varchar(1000)','varchar');--omnidb-- +INSERT INTO representatives VALUES('boolean','mysql','boolean','boolean');--omnidb-- +INSERT INTO representatives VALUES('varchar','postgresql','character varying','character varying');--omnidb-- +INSERT INTO representatives VALUES('decimal','mysql','decimal(38,0)','decimal');--omnidb-- +INSERT INTO representatives VALUES('decimal','firebird','decimal(38,0)','decimal');--omnidb-- +INSERT INTO representatives VALUES('smallint','firebird','smallint','smallint');--omnidb-- +INSERT INTO representatives VALUES('integer','firebird','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('bigint','firebird','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('varchar','firebird','varchar(1000)','varchar');--omnidb-- +INSERT INTO representatives VALUES('boolean','firebird','char(1)','char');--omnidb-- +INSERT INTO representatives VALUES('fp','firebird','double precision','double precision');--omnidb-- +INSERT INTO representatives VALUES('datetime','postgresql','timestamp without time zone','timestamp without time zone');--omnidb-- +INSERT INTO representatives VALUES('decimal','sqlite','numeric(38,0)','numeric');--omnidb-- +INSERT INTO representatives VALUES('smallint','sqlite','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('integer','sqlite','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('bigint','sqlite','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('varchar','sqlite','varchar(1000)','varchar');--omnidb-- +INSERT INTO representatives VALUES('boolean','sqlite','char(1)','char');--omnidb-- +INSERT INTO representatives VALUES('fp','sqlite','real','real');--omnidb-- +INSERT INTO representatives VALUES('varchar','sqlserver','varchar(1000)','varchar');--omnidb-- +INSERT INTO representatives VALUES('char','firebird','char(1000)','char');--omnidb-- +INSERT INTO representatives VALUES('char','mysql','char(255)','char');--omnidb-- +INSERT INTO representatives VALUES('char','oracle','char(1000)','char');--omnidb-- +INSERT INTO representatives VALUES('char','postgresql','char(1000)','char');--omnidb-- +INSERT INTO representatives VALUES('char','sqlite','char(1000)','char');--omnidb-- +INSERT INTO representatives VALUES('char','sqlserver','char(1000)','char');--omnidb-- +INSERT INTO representatives VALUES('text','firebird','BLOB SUB_TYPE TEXT','BLOB SUB_TYPE TEXT');--omnidb-- +INSERT INTO representatives VALUES('text','mysql','text','text');--omnidb-- +INSERT INTO representatives VALUES('text','oracle','clob','clob');--omnidb-- +INSERT INTO representatives VALUES('text','postgresql','text','text');--omnidb-- +INSERT INTO representatives VALUES('text','sqlite','text','text');--omnidb-- +INSERT INTO representatives VALUES('text','sqlserver','text','text');--omnidb-- +INSERT INTO representatives VALUES('decimal','sqlserver','decimal(38,0)','decimal');--omnidb-- +INSERT INTO representatives VALUES('smallint','sqlserver','smallint','smallint');--omnidb-- +INSERT INTO representatives VALUES('integer','sqlserver','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('bigint','sqlserver','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('boolean','sqlserver','char(1)','char');--omnidb-- +INSERT INTO representatives VALUES('fp','sqlserver','real','real');--omnidb-- +INSERT INTO representatives VALUES('datetime','firebird','timestamp','timestamp');--omnidb-- +INSERT INTO representatives VALUES('datetime','mysql','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('datetime','oracle','date','date');--omnidb-- +INSERT INTO representatives VALUES('datetime','sqlite','text','text');--omnidb-- +INSERT INTO representatives VALUES('datetime','sqlserver','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('datetime','access','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('text','access','text','text');--omnidb-- +INSERT INTO representatives VALUES('smallint','access','int','int');--omnidb-- +INSERT INTO representatives VALUES('integer','access','int','int');--omnidb-- +INSERT INTO representatives VALUES('bigint','access','int','int');--omnidb-- +INSERT INTO representatives VALUES('fp','access','double','double');--omnidb-- +INSERT INTO representatives VALUES('boolean','access','boolean','boolean');--omnidb-- +INSERT INTO representatives VALUES('decimal','access','numeric','numeric');--omnidb-- +INSERT INTO representatives VALUES('char','access','text','text');--omnidb-- +INSERT INTO representatives VALUES('varchar','access','text','text');--omnidb-- +INSERT INTO representatives VALUES('date','postgresql','date','date');--omnidb-- +INSERT INTO representatives VALUES('time','postgresql','time without time zone','time without time zone');--omnidb-- +INSERT INTO representatives VALUES('time','sqlite','text','text');--omnidb-- +INSERT INTO representatives VALUES('date','sqlite','text','text');--omnidb-- +INSERT INTO representatives VALUES('date','mysql','date','date');--omnidb-- +INSERT INTO representatives VALUES('time','mysql','time','time');--omnidb-- +INSERT INTO representatives VALUES('time','firebird','time','time');--omnidb-- +INSERT INTO representatives VALUES('date','firebird','date','date');--omnidb-- +INSERT INTO representatives VALUES('date','oracle','date','date');--omnidb-- +INSERT INTO representatives VALUES('time','oracle','date','date');--omnidb-- +INSERT INTO representatives VALUES('date','access','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('time','access','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('date','sqlserver','date','date');--omnidb-- +INSERT INTO representatives VALUES('time','sqlserver','time','time');--omnidb-- +INSERT INTO representatives VALUES('varchar','sqlce','ntext','ntext');--omnidb-- +INSERT INTO representatives VALUES('char','sqlce','ntext','ntext');--omnidb-- +INSERT INTO representatives VALUES('text','sqlce','ntext','ntext');--omnidb-- +INSERT INTO representatives VALUES('decimal','sqlce','numeric(38,0)','numeric');--omnidb-- +INSERT INTO representatives VALUES('smallint','sqlce','smallint','smallint');--omnidb-- +INSERT INTO representatives VALUES('integer','sqlce','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('bigint','sqlce','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('boolean','sqlce','ntext','ntext');--omnidb-- +INSERT INTO representatives VALUES('fp','sqlce','real','real');--omnidb-- +INSERT INTO representatives VALUES('datetime','sqlce','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('date','sqlce','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('time','sqlce','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('fp','mariadb','double precision','double precision');--omnidb-- +INSERT INTO representatives VALUES('smallint','mariadb','smallint','smallint');--omnidb-- +INSERT INTO representatives VALUES('integer','mariadb','integer','integer');--omnidb-- +INSERT INTO representatives VALUES('bigint','mariadb','bigint','bigint');--omnidb-- +INSERT INTO representatives VALUES('varchar','mariadb','varchar(1000)','varchar');--omnidb-- +INSERT INTO representatives VALUES('boolean','mariadb','boolean','boolean');--omnidb-- +INSERT INTO representatives VALUES('decimal','mariadb','decimal(38,0)','decimal');--omnidb-- +INSERT INTO representatives VALUES('char','mariadb','char(255)','char');--omnidb-- +INSERT INTO representatives VALUES('text','mariadb','text','text');--omnidb-- +INSERT INTO representatives VALUES('datetime','mariadb','datetime','datetime');--omnidb-- +INSERT INTO representatives VALUES('date','mariadb','date','date');--omnidb-- +INSERT INTO representatives VALUES('time','mariadb','time','time');--omnidb-- +INSERT INTO representatives VALUES('varchar','filedb','varchar(1000)','varchar');--omnidb-- + +CREATE TABLE themes ( + theme_id integer not null, + theme_name varchar(50), + theme_type varchar(50), + constraint pk_themes primary key (theme_id) +);--omnidb-- +INSERT INTO themes VALUES(1,'omnidb','light');--omnidb-- +INSERT INTO themes VALUES(2,'chrome','light');--omnidb-- +INSERT INTO themes VALUES(3,'clouds','light');--omnidb-- +INSERT INTO themes VALUES(4,'crimson_editor','light');--omnidb-- +INSERT INTO themes VALUES(5,'dawn','light');--omnidb-- +INSERT INTO themes VALUES(6,'dreamweaver','light');--omnidb-- +INSERT INTO themes VALUES(7,'eclipse','light');--omnidb-- +INSERT INTO themes VALUES(8,'github','light');--omnidb-- +INSERT INTO themes VALUES(9,'iplastic','light');--omnidb-- +INSERT INTO themes VALUES(10,'katzenmilch','light');--omnidb-- +INSERT INTO themes VALUES(11,'kuroir','light');--omnidb-- +INSERT INTO themes VALUES(12,'solarized_light','light');--omnidb-- +INSERT INTO themes VALUES(13,'sqlserver','light');--omnidb-- +INSERT INTO themes VALUES(14,'textmate','light');--omnidb-- +INSERT INTO themes VALUES(15,'tomorrow','light');--omnidb-- +INSERT INTO themes VALUES(16,'xcode','light');--omnidb-- +INSERT INTO themes VALUES(17,'omnidb_dark','dark');--omnidb-- +INSERT INTO themes VALUES(18,'ambiance','dark');--omnidb-- +INSERT INTO themes VALUES(19,'chaos','dark');--omnidb-- +INSERT INTO themes VALUES(20,'clouds_midnight','dark');--omnidb-- +INSERT INTO themes VALUES(21,'cobalt','dark');--omnidb-- +INSERT INTO themes VALUES(22,'idle_fingers','dark');--omnidb-- +INSERT INTO themes VALUES(23,'kr_theme','dark');--omnidb-- +INSERT INTO themes VALUES(24,'merbivore','dark');--omnidb-- +INSERT INTO themes VALUES(25,'merbivore_soft','dark');--omnidb-- +INSERT INTO themes VALUES(26,'mono_industrial','dark');--omnidb-- +INSERT INTO themes VALUES(27,'monokai','dark');--omnidb-- +INSERT INTO themes VALUES(28,'pastel_on_dark','dark');--omnidb-- +INSERT INTO themes VALUES(29,'solarized_dark','dark');--omnidb-- +INSERT INTO themes VALUES(30,'terminal','dark');--omnidb-- +INSERT INTO themes VALUES(31,'tomorrow_night','dark');--omnidb-- +INSERT INTO themes VALUES(32,'tomorrow_night_blue','dark');--omnidb-- +INSERT INTO themes VALUES(33,'tomorrow_night_bright','dark');--omnidb-- +INSERT INTO themes VALUES(34,'tomorrow_night_eighties','dark');--omnidb-- +INSERT INTO themes VALUES(35,'twilight','dark');--omnidb-- +INSERT INTO themes VALUES(36,'vibrant_ink','dark');--omnidb-- + +CREATE TABLE users ( + user_id integer not null, + user_name varchar(30), + password varchar(100), + theme_id integer, + editor_font_size varchar(10), + chat_enabled integer, + super_user integer, + csv_encoding varchar(20), + csv_delimiter varchar(10), + interface_font_size text, + welcome_closed integer, + constraint pk_users primary key (user_id), + constraint users_fk_0 foreign key (theme_id) references themes (theme_id) on update NO ACTION on delete NO ACTION, + constraint uq_users_0 unique (user_name) +);--omnidb-- +INSERT INTO users VALUES(1,'admin','48b19163bdb02cadab1a09c9dd4eafae',1,'14',1,1,'utf-8',';','11',0);--omnidb-- + +CREATE TABLE messages ( + mes_in_code integer not null, + mes_st_text text, + mes_dt_timestamp text not null, + user_id integer not null, + mes_bo_image integer not null, + constraint pk_messages primary key (mes_in_code), + constraint messages_fk_0 foreign key (user_id) references users (user_id) on update NO ACTION on delete CASCADE +);--omnidb-- + +CREATE TABLE messages_users ( + mes_in_code integer not null, + user_id integer not null, + constraint pk_messages_users primary key (mes_in_code, user_id), + constraint messages_users_fk_0 foreign key (mes_in_code) references messages (mes_in_code) on update NO ACTION on delete CASCADE, + constraint messages_users_fk_1 foreign key (user_id) references users (user_id) on update NO ACTION on delete CASCADE +);--omnidb-- + +CREATE TABLE snippets_nodes ( + sn_id integer not null, + sn_name text,user_id integer not null, + sn_date_create text, + sn_date_modify text, + sn_id_parent integer, + constraint pk_snippets_nodes primary key (sn_id), + constraint fk_sn_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, + constraint fk_sn_sn foreign key (sn_id_parent) references snippets_nodes (sn_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE snippets_texts ( + st_id integer not null, + st_name text, + st_text text, + st_date_create text, + st_date_modify text, + sn_id_parent integer, + user_id integer not null, + constraint pk_snippets_texts primary key (st_id), + constraint fk_st_sn foreign key (sn_id_parent) references snippets_nodes (sn_id) on update CASCADE on delete CASCADE, + constraint fk_st_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE connections ( + conn_id integer, + user_id integer, + dbt_st_name varchar(40), + server varchar(500), + port varchar(20), + service varchar(500), + user varchar(100), + alias varchar(100), + ssh_server varchar(500), + ssh_port varchar(20), + ssh_user varchar(100), + ssh_password varchar(100), + ssh_key text, + use_tunnel integer, + conn_string text, + constraint pk_connections primary key (conn_id), + constraint connections_fk_0 foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, + constraint connections_fk_1 foreign key (dbt_st_name) references db_type (dbt_st_name) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE conversions ( + conv_id integer,conn_id_src integer, + conn_id_dst integer, + conv_st_start varchar(100), + conv_st_end varchar(100), + conv_re_perc real, + conv_ch_status char, + conv_st_comments varchar(500), + conv_st_duration varchar(100), + user_id integer,process_id integer, + constraint pk_conversions primary key (conv_id), + constraint conversions_fk_0 foreign key (conn_id_src) references connections (conn_id) on update CASCADE on delete CASCADE, + constraint conversions_fk_1 foreign key (conn_id_dst) references connections (conn_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE conv_tables_data ( + conv_id integer, + ctd_st_table text, + ctd_ch_droprecords char, + ctd_ch_createtable char, + ctd_ch_createpk char, + ctd_ch_createfk char, + ctd_ch_createuq char, + ctd_ch_createidx char, + ctd_ch_transferdata char, + ctd_in_totalrecords integer, + ctd_in_transfrecords integer, + ctd_re_transfperc real, + ctd_re_transferrate real, + ctd_st_starttransfer text, + ctd_st_endtransfer text, + ctd_st_duration text, + ctd_st_status_droprecords text, + ctd_st_status_createtable text, + ctd_st_status_createpk text, + ctd_st_status_createfk text, + ctd_st_status_createuq text, + ctd_st_status_createidx text, + ctd_st_status_transferdata text, + ctd_st_transferfilter text, + constraint pk_conv_tables_data primary key (conv_id, ctd_st_table), + constraint conv_tables_data_fk_0 foreign key (conv_id) references conversions (conv_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE command_list ( + user_id integer not null, + cl_in_codigo integer not null, + cl_st_command text, + cl_st_start text, + cl_st_end text, + cl_st_status text, + cl_st_duration text, + conn_id integer not null, + constraint pk_command_list primary key (cl_in_codigo), + constraint command_list_fk_0 foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, + constraint fk_cl_conn foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE tabs ( + conn_id integer not null, + user_id integer not null, + tab_id integer not null, + snippet text, + title text, + constraint fk_tabs_conn foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE, + constraint fk_tabs_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE mon_units ( + unit_id integer not null, + dbt_st_name text, + script_chart text, + script_data text, + type text, + title text, + is_default integer, + user_id integer, + interval integer, + constraint pk_mon_units primary key (unit_id), + constraint fk_mu_dbt foreign key (dbt_st_name) references db_type (dbt_st_name) on update NO ACTION on delete NO ACTION, + constraint fk_mu_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE +);--omnidb-- +INSERT INTO mon_units VALUES(1,'postgresql',replace('max_connections = connection.ExecuteScalar(''SHOW max_connections'')\n\nresult = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Backends (max_connections: " + str(max_connections) + ")"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Value"\n },\n "ticks": {\n "beginAtZero": True,\n "max": int(max_connections)\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT d.datname,\n s.numbackends\n FROM pg_stat_database s\n INNER JOIN pg_database d\n ON d.oid = s.datid\n WHERE NOT d.datistemplate\n'''''')\n\ndatasets = []\nfor db in databases.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": db[''datname''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [db["numbackends"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Backends',1,NULL,5);--omnidb-- +INSERT INTO mon_units VALUES(2,'postgresql',replace('total_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Database Size (Total: " + str(total_size) + " MB)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT datname AS datname,\n round(pg_catalog.pg_database_size(datname)/1048576.0,2) AS size\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n ORDER BY\n CASE WHEN pg_catalog.has_database_privilege(datname, ''CONNECT'')\n THEN pg_catalog.pg_database_size(datname)\n ELSE NULL\n END DESC\n'''''')\n\ndatasets = []\nfor db in databases.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": db[''datname''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [db["size"]]\n })\n\ntotal_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets,\n "title": "Database Size (Total: " + str(total_size) + " MB)"\n}\n','\n',char(10)),'chart_append','Database Size',1,NULL,30);--omnidb-- +INSERT INTO mon_units VALUES(3,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Size: Top 5 Tables"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntables = connection.Query(''''''\n SELECT nspname || ''.'' || relname AS relation,\n round(pg_relation_size(c.oid)/1048576.0,2) AS size\n FROM pg_class c\n LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)\n WHERE nspname NOT IN (''pg_catalog'', ''information_schema'')\n AND c.relkind <> ''i''\n AND nspname !~ ''^pg_toast''\n ORDER BY pg_total_relation_size(c.oid) DESC\n LIMIT 5\n'''''')\n\ndatasets = []\nfor table in tables.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": table[''relation''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [table["size"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Size: Top 5 Tables',0,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(4,'postgresql','',replace('from datetime import datetime\n\ndata = connection.Query(''''''\n SELECT *\n FROM pg_stat_activity\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}\n','\n',char(10)),'grid','Activity',0,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(5,'postgresql','',replace('from datetime import datetime\n\ndata = connection.Query(''''''\n SELECT z.current_database,z.schemaname,z.tablename, pg_size_pretty(sum_wasted) AS total_bloat\n FROM (\n SELECT y.schemaname, y.tablename, y.current_database, sum(wastedbytes+wastedibytes)::bigint AS sum_wasted\n FROM (\n SELECT current_database,schemaname, tablename, tbloat, wastedbytes, iname, ibloat, wastedibytes AS wastedibytes\n FROM (\n SELECT\n current_database(), schemaname, tablename, /*reltuples::bigint, relpages::bigint, otta,*/\n ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat,\n CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::BIGINT END AS wastedbytes,\n iname, /*ituples::bigint, ipages::bigint, iotta,*/\n ROUND((CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages::FLOAT/iotta END)::NUMERIC,1) AS ibloat,\n CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes\n FROM (\n SELECT\n schemaname, tablename, cc.reltuples, cc.relpages, bs,\n CEIL((cc.reltuples*((datahdr+ma-\n (CASE WHEN datahdr%ma=0 THEN ma ELSE datahdr%ma END))+nullhdr2+4))/(bs-20::FLOAT)) AS otta,\n COALESCE(c2.relname,''?'') AS iname, COALESCE(c2.reltuples,0) AS ituples, COALESCE(c2.relpages,0) AS ipages,\n COALESCE(CEIL((c2.reltuples*(datahdr-12))/(bs-20::FLOAT)),0) AS iotta -- very rough approximation, assumes all cols\n FROM (\n SELECT\n ma,bs,schemaname,tablename,\n (datawidth+(hdr+ma-(CASE WHEN hdr%ma=0 THEN ma ELSE hdr%ma END)))::NUMERIC AS datahdr,\n (maxfracsum*(nullhdr+ma-(CASE WHEN nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2\n FROM (\n SELECT\n schemaname, tablename, hdr, ma, bs,\n SUM((1-null_frac)*avg_width) AS datawidth,\n MAX(null_frac) AS maxfracsum,\n hdr+(\n SELECT 1+COUNT(*)/8\n FROM pg_stats s2\n WHERE null_frac<>0 AND s2.schemaname = s.schemaname AND s2.tablename = s.tablename\n ) AS nullhdr\n FROM pg_stats s, (\n SELECT\n (SELECT current_setting(''block_size'')::NUMERIC) AS bs,\n CASE WHEN SUBSTRING(v,12,3) IN (''8.0'',''8.1'',''8.2'') THEN 27 ELSE 23 END AS hdr,\n CASE WHEN v ~ ''mingw32'' THEN 8 ELSE 4 END AS ma\n FROM (SELECT version() AS v) AS foo\n ) AS constants\n GROUP BY 1,2,3,4,5\n ) AS foo\n ) AS rs\n JOIN pg_class cc ON cc.relname = rs.tablename\n JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> ''information_schema''\n LEFT JOIN pg_index i ON indrelid = cc.oid\n LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid\n ) AS sml) x) y\n GROUP BY y.schemaname, y.tablename, y.current_database) z\n ORDER BY z.sum_wasted DESC\n LIMIT 20\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}','\n',char(10)),'grid','Bloat: Top 20 Tables',0,NULL,30);--omnidb-- +INSERT INTO mon_units VALUES(6,'postgresql',replace('max_connections = connection.ExecuteScalar(''SHOW max_connections'')\n\nresult = {\n "type": "pie",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Backends (max_connections: " + str(max_connections) + ")"\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT d.datname,\n s.numbackends\n FROM pg_stat_database s\n INNER JOIN pg_database d\n ON d.oid = s.datid\n WHERE NOT d.datistemplate\n'''''')\n\ndata = []\ncolor = []\nlabel = []\n\nfor db in databases.Rows:\n data.append(db["numbackends"])\n color.append("rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")")\n label.append(db["datname"])\n\nresult = {\n "labels": label,\n "datasets": [\n {\n "data": data,\n "backgroundColor": color,\n "label": "Dataset 1"\n }\n ]\n}\n','\n',char(10)),'chart','Backends',1,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(7,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"CPU Usage"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Value",\n },\n "ticks": {\n "beginAtZero": True,\n "max": 100\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntry:\n cpu_data = connection.Query(''''''\n create temporary table tabela (c1 text);\n copy tabela from program ''mpstat -P ALL 1 1 | grep "Average:" | tail -n +2 | tr -s " " | cut -f2,3 -d" "'';\n select * from tabela;\n '''''')\nexcept:\n raise Exception(''This chart can not be executed in a standby server.'')\n\nif len(cpu_data.Rows) == 0:\n raise Exception(''This chart can only be executed in a Linux server.'')\n\ndatasets = []\nfor cpu in cpu_data.Rows:\n if cpu!='''':\n cpu_split = cpu[0].split('' '')\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": cpu_split[0],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [cpu_split[1]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','CPU Usage',0,NULL,10);--omnidb-- +INSERT INTO mon_units VALUES(8,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Locks"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Num locks"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nlocks = connection.Query(''''''\n SELECT mode,\n count(*) as count\n FROM pg_locks\n GROUP BY mode\n'''''')\n\ndatasets = []\nfor lock in locks.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": lock[''mode''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [lock["count"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Locks',1,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(9,'postgresql','',replace('data = connection.Query(''''''\n SELECT pg_is_in_recovery() as "In Recovery"\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}','\n',char(10)),'grid','In Recovery',0,NULL,120);--omnidb-- +INSERT INTO mon_units VALUES(10,'postgresql',replace('total_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "type": "pie",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Database Size (Total: " + str(total_size) + " MB)"\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ndatabases = connection.Query(''''''\n SELECT d.datname AS datname,\n round(pg_catalog.pg_database_size(d.datname)/1048576.0,2) AS size\n FROM pg_catalog.pg_database d\n WHERE d.datname not in (''template0'',''template1'')\n'''''')\n\ndata = []\ncolor = []\nlabel = []\n\nfor db in databases.Rows:\n data.append(db["size"])\n color.append("rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")")\n label.append(db["datname"])\n\ntotal_size = connection.ExecuteScalar(''''''\n SELECT round(sum(pg_catalog.pg_database_size(datname)/1048576.0),2)\n FROM pg_catalog.pg_database\n WHERE NOT datistemplate\n'''''')\n\nresult = {\n "labels": label,\n "datasets": [\n {\n "data": data,\n "backgroundColor": color,\n "label": "Dataset 1"\n }\n ],\n "title": "Database Size (Total: " + str(total_size) + " MB)"\n}\n','\n',char(10)),'chart','Database Size',1,NULL,30);--omnidb-- +INSERT INTO mon_units VALUES(11,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Bloat: Top 5 Tables"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntables = connection.Query(''''''\n SELECT z.schemaname || ''.'' || z.tablename as relation, sum_wasted/1048576.0 AS size\n FROM (\n SELECT y.schemaname, y.tablename, y.current_database, wastedbytes + sum(wastedibytes)::bigint AS sum_wasted\n FROM (\n SELECT current_database,schemaname, tablename, tbloat, wastedbytes, iname, ibloat, wastedibytes AS wastedibytes\n FROM (\n SELECT\n current_database(), schemaname, tablename, /*reltuples::bigint, relpages::bigint, otta,*/\n ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat,\n CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::BIGINT END AS wastedbytes,\n iname, /*ituples::bigint, ipages::bigint, iotta,*/\n ROUND((CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages::FLOAT/iotta END)::NUMERIC,1) AS ibloat,\n CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes\n FROM (\n SELECT\n schemaname, tablename, cc.reltuples, cc.relpages, bs,\n CEIL((cc.reltuples*((datahdr+ma-\n (CASE WHEN datahdr%ma=0 THEN ma ELSE datahdr%ma END))+nullhdr2+4))/(bs-20::FLOAT)) AS otta,\n COALESCE(c2.relname,''?'') AS iname, COALESCE(c2.reltuples,0) AS ituples, COALESCE(c2.relpages,0) AS ipages,\n COALESCE(CEIL((c2.reltuples*(datahdr-12))/(bs-20::FLOAT)),0) AS iotta -- very rough approximation, assumes all cols\n FROM (\n SELECT\n ma,bs,schemaname,tablename,\n (datawidth+(hdr+ma-(CASE WHEN hdr%ma=0 THEN ma ELSE hdr%ma END)))::NUMERIC AS datahdr,\n (maxfracsum*(nullhdr+ma-(CASE WHEN nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2\n FROM (\n SELECT\n schemaname, tablename, hdr, ma, bs,\n SUM((1-null_frac)*avg_width) AS datawidth,\n MAX(null_frac) AS maxfracsum,\n hdr+(\n SELECT 1+COUNT(*)/8\n FROM pg_stats s2\n WHERE null_frac<>0 AND s2.schemaname = s.schemaname AND s2.tablename = s.tablename\n ) AS nullhdr\n FROM pg_stats s, (\n SELECT\n (SELECT current_setting(''block_size'')::NUMERIC) AS bs,\n CASE WHEN SUBSTRING(v,12,3) IN (''8.0'',''8.1'',''8.2'') THEN 27 ELSE 23 END AS hdr,\n CASE WHEN v ~ ''mingw32'' THEN 8 ELSE 4 END AS ma\n FROM (SELECT version() AS v) AS foo\n ) AS constants\n GROUP BY 1,2,3,4,5\n ) AS foo\n ) AS rs\n JOIN pg_class cc ON cc.relname = rs.tablename\n JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> ''information_schema''\n LEFT JOIN pg_index i ON indrelid = cc.oid\n LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid\n ) AS sml) x) y\n GROUP BY y.schemaname, y.tablename, y.current_database, y.wastedbytes) z\n ORDER BY z.sum_wasted DESC\n LIMIT 5\n'''''')\n\ndatasets = []\nfor table in tables.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": table[''relation''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [table["size"]]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Bloat: Top 5 Tables',0,NULL,45);--omnidb-- +INSERT INTO mon_units VALUES(12,'postgresql','',replace('from datetime import datetime\n\ndata = connection.Query(''''''\n SELECT relname as table_name,\n pg_size_pretty(pg_table_size(oid)) as table_size,\n age(relfrozenxid) as xid_age,\n current_setting(''autovacuum_freeze_max_age'')::integer as max_age,\n round(age(relfrozenxid)/(current_setting(''autovacuum_freeze_max_age'')::integer)::numeric*100.0,4) as perc\n FROM pg_class\n WHERE relkind in (''r'', ''t'')\n ORDER BY age(relfrozenxid) DESC\n LIMIT 20;\n'''''')\n\nresult = {\n "columns": data.Columns,\n "data": data.Rows\n}\n','\n',char(10)),'grid','AutovacFreeze: Top 20 Tables',0,NULL,60);--omnidb-- +INSERT INTO mon_units VALUES(13,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Master: Replication Lag"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nreplags = connection.Query(''''''\n CREATE TEMPORARY TABLE omnidb_monitor_result (result1 TEXT, result2 TEXT);\n DO $$\n BEGIN\n IF current_setting(''server_version_num'')::integer < 100000 THEN\n EXECUTE ''INSERT INTO omnidb_monitor_result SELECT client_addr || ''''-'''' || application_name as standby,''\n ''round(pg_xlog_location_diff(pg_current_xlog_location(),replay_location)/1048576.0,2) as lag ''\n ''FROM pg_stat_replication'';\n ELSE\n EXECUTE ''INSERT INTO omnidb_monitor_result SELECT client_addr || ''''-'''' || application_name as standby,''\n ''round(pg_wal_lsn_diff(pg_current_wal_lsn(),replay_lsn)/1048576.0,2) as lag ''\n ''FROM pg_stat_replication'';\n END IF;\n END$$;\n SELECT result1 as standby, result2 as lag FROM omnidb_monitor_result;\n'''''')\n\ndatasets = []\nfor replag in replags.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": replag[''standby''],\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [replag[''lag'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Master: Replication Lag',0,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(14,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Standby: Replication Lag (Size)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size (MB)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nreplags = connection.Query(''''''\n CREATE TEMPORARY TABLE omnidb_monitor_result (result TEXT);\n DO $$DECLARE r record;\n BEGIN\n IF current_setting(''server_version_num'')::integer < 100000 THEN\n EXECUTE ''INSERT INTO omnidb_monitor_result ''\n ''SELECT round(pg_xlog_location_diff(pg_last_xlog_receive_location(), pg_last_xlog_replay_location())/1048576.0,2) AS lag'';\n ELSE\n EXECUTE ''INSERT INTO omnidb_monitor_result ''\n ''SELECT round(pg_wal_lsn_diff(pg_last_wal_receive_lsn(), pg_last_wal_replay_lsn())/1048576.0,2) AS lag'';\n END IF;\n END$$;\n SELECT result as lag FROM omnidb_monitor_result;\n'''''')\n\ndatasets = []\nfor replag in replags.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": "Lag",\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [replag[''lag'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Standby: Replication Lag (Size)',0,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(15,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"Standby: Replication Lag (Time)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Seconds"\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nreplags = connection.Query(''''''\n SELECT COALESCE(ROUND(EXTRACT(epoch FROM now() - pg_last_xact_replay_timestamp())),0) AS lag\n'''''')\n\ndatasets = []\nfor replag in replags.Rows:\n color = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\n datasets.append({\n "label": "Lag",\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [replag[''lag'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Standby: Replication Lag (Time)',0,NULL,15);--omnidb-- +INSERT INTO mon_units VALUES(16,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "responsive": True,\n "title":{\n "display":True,\n "text":"System Memory Usage (Total: " + total_mem + "MB)"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "%",\n },\n "ticks": {\n "beginAtZero": True,\n "max": 100\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntry:\n mem_data = connection.ExecuteScalar(''''''\n create temporary table tabela (c1 text);\n copy tabela from program ''free -m | tail -n +2 | head -n 1 | tr -s " " | cut -f2,3,4 -d " "'';\n select * from tabela;\n '''''')\nexcept:\n raise Exception(''This chart can not be executed in a standby server.'')\n\nif mem_data is None:\n raise Exception(''This chart can only be executed in a Linux server.'')\n\ndatasets = []\nmem_split = mem_data.split('' '')\ntotal_mem = mem_split[0]\nused_mem = mem_split[1]\nfree_mem = mem_split[2]\nperc_mem = round(int(used_mem)*100/int(total_mem),2)\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": "Memory",\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [perc_mem]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Memory Usage',0,NULL,10);--omnidb-- +INSERT INTO mon_units VALUES(17,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":True,\n "text":"Longest Active Query"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Duration(s)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nduration = connection.ExecuteScalar(''''''\n SELECT duration FROM\n (SELECT EXTRACT(EPOCH FROM(now() - query_start))::INTEGER AS duration FROM pg_stat_activity WHERE state=''active''\n UNION ALL\n SELECT 0) t\n WHERE duration is NOT NULL\n ORDER BY duration DESC\n LIMIT 1\n'''''')\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''Query'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [duration]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','Longest Active Query',0,NULL,5);--omnidb-- +INSERT INTO mon_units VALUES(18,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":True,\n "text":"WAL Folder Size"\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "Size(MB)"\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}\n','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nsize = connection.ExecuteScalar(''''''\n CREATE TEMPORARY TABLE omnidb_temp (c1 TEXT, c2 TEXT);\n COPY omnidb_temp FROM PROGRAM ''du -s pg_xlog || du -s pg_wal'';\n SELECT ROUND(c1::BIGINT/1048576.0,2) AS pg_xlog_size FROM omnidb_temp;\n'''''')\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''WAL Folder Size'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [size]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets\n}\n','\n',char(10)),'chart_append','WAL Folder Size',0,NULL,30);--omnidb-- +INSERT INTO mon_units VALUES(19,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":False\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": False,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": True,\n "labelString": "MB/s"\n },\n "ticks": {\n "beginAtZero": True,\n "suggestedMax": 1\n }\n }]\n }\n }\n}','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\ntry:\n if previous_data != None:\n query = "select round(pg_wal_lsn_diff(pg_current_wal_lsn(),''" + previous_data["current_lsn"] + "'')/(1048576*extract(epoch from now()::time - ''" + previous_data["current_time"] + "''::time))::numeric,2) as wal_rate, pg_current_wal_lsn() as current_lsn, now()::time as current_time"\n else:\n query = ''select 0 as wal_rate, pg_current_wal_lsn() as current_lsn, now()::time as current_time''\n query_data = connection.Query(query)\nexcept:\n if previous_data != None:\n query = "select round(pg_xlog_location_diff(pg_current_xlog_location(),''" + previous_data["current_lsn"] + "'')/(1048576*extract(epoch from now()::time - ''" + previous_data["current_time"] + "''::time))::numeric,2) as wal_rate, pg_current_xlog_location() as current_lsn, now()::time as current_time"\n else:\n query = ''select 0 as wal_rate, pg_current_xlog_location() as current_lsn, now()::time as current_time''\n query_data = connection.Query(query)\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''Rate'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 1,\n "borderWidth": 1,\n "data": [query_data.Rows[0][''wal_rate'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets,\n "current_lsn": query_data.Rows[0][''current_lsn''],\n ''current_time'': query_data.Rows[0][''current_time'']\n}','\n',char(10)),'chart_append','WAL Production Rate',0,NULL,10);--omnidb-- +INSERT INTO mon_units VALUES(20,'postgresql',replace('result = {\n "type": "line",\n "data": None,\n "options": {\n "legend": {\n "display": False\n },\n "responsive": True,\n "title":{\n "display":False\n },\n "tooltips": {\n "mode": "index",\n "intersect": False\n },\n "hover": {\n "mode": "nearest",\n "intersect": True\n },\n "scales": {\n "xAxes": [{\n "display": True,\n "scaleLabel": {\n "display": False,\n "labelString": "Time"\n }\n }],\n "yAxes": [{\n "display": True,\n "scaleLabel": {\n "display": False\n },\n "ticks": {\n "beginAtZero": True\n }\n }]\n }\n }\n}','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nif previous_data != None:\n query = "select round((sum(xact_commit+xact_rollback) - " + previous_data["current_count"] + ")/(extract(epoch from now()::time - ''" + previous_data["current_time"] + "''::time))::numeric,2) as tps, sum(xact_commit+xact_rollback) as current_count, now()::time as current_time FROM pg_stat_database"\nelse:\n query = ''select 0 as tps, sum(xact_commit+xact_rollback) as current_count, now()::time as current_time FROM pg_stat_database''\n\nquery_data = connection.Query(query)\n\ndatasets = []\ncolor = "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")"\ndatasets.append({\n "label": ''Rate'',\n "fill": False,\n "backgroundColor": color,\n "borderColor": color,\n "lineTension": 0,\n "pointRadius": 0,\n "borderWidth": 1,\n "data": [query_data.Rows[0][''tps'']]\n })\n\nresult = {\n "labels": [datetime.now().strftime(''%H:%M:%S'')],\n "datasets": datasets,\n "current_count": query_data.Rows[0][''current_count''],\n ''current_time'': query_data.Rows[0][''current_time'']\n}','\n',char(10)),'chart_append','TPS',1,NULL,10);--omnidb-- +INSERT INTO mon_units VALUES(21,'postgresql',replace('from random import randint\n\nresult = {\n "container": None,\n "boxSelectionEnabled": False,\n "autounselectify": True,\n "layout": {\n "name": "spread",\n "minDist": 1000\n },\n "style": [\n {\n "selector": "node",\n "style": {\n "content": "data(label)",\n "text-opacity": 1,\n "text-valign": "top",\n "text-halign": "right",\n "text-wrap": "wrap",\n "color": "gray",\n "text-rotation": "autorotate",\n "font-size": 12\n }\n },\n {\n "selector": "node.node_local",\n "style": {\n "background-color": "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")",\n "shape": ''square''\n }\n },\n {\n "selector": "node.node_remote",\n "style": {\n "background-color": "rgb(" + str(randint(125, 225)) + "," + str(randint(125, 225)) + "," + str(randint(125, 225)) + ")",\n }\n },\n {\n "selector": "edge",\n "style": {\n "curve-style": "bezier",\n "control-point-step-size": 40,\n "target-arrow-shape": "triangle",\n "text-opacity": 1,\n "width": 2,\n "control-point-distances": 50,\n "content": "data(label)",\n "text-wrap": "wrap",\n "line-style": "solid",\n "width": 1,\n "color": "gray",\n "text-outline-color": ''gray'',\n "text-outline-width": 0\n }\n }\n ],\n "elements": {\n "nodes": None,\n "edges": None\n }\n}','\n',char(10)),replace('from datetime import datetime\nfrom random import randint\n\nnodes = []\nedges = []\n\ntry:\n repl_nodes = connection.Query(''''''\n select application_name,\n pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(),coalesce(replay_lsn,flush_lsn))) lag_size\n from pg_stat_replication\n '''''')\nexcept:\n repl_nodes = connection.Query(''''''\n select application_name,\n pg_size_pretty(pg_xlog_location_diff(pg_current_xlog_location(),coalesce(replay_location,flush_location)) lag_size\n from pg_stat_replication\n '''''')\n\nif len(repl_nodes.Rows) == 0:\n raise Exception(''There are no nodes replicating from this instance.'')\n\nnodes.append({\n "data": {\n "id": ''local'',\n "label": ''local'',\n },\n "classes": ''node_local''\n })\n\nfor repl_node in repl_nodes.Rows:\n nodes.append({\n "data": {\n "id": ''node_'' + repl_node[''application_name''],\n "label": repl_node[''application_name'']\n },\n "classes": ''node_remote''\n })\n edges.append({\n "data": {\n "id": ''edge_'' + repl_node[''application_name''],\n "label": repl_node[''lag_size''],\n "source": ''local'',\n "target": ''node_'' + repl_node[''application_name'']\n }\n })\n\nresult = {\n "nodes": nodes,\n "edges": edges\n}','\n',char(10)),'graph','Replication',0,NULL,10);--omnidb-- + +CREATE TABLE units_users_connections ( + uuc_id integer not null, + unit_id integer not null, + user_id integer not null, + conn_id integer not null, + interval integer not null, + plugin_name text, + constraint pk_units_users_connections primary key (uuc_id), + constraint units_users_connections_fk_0 foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE, + constraint units_users_connections_fk_1 foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE shortcuts ( + user_id integer, + shortcut_code text, + ctrl_pressed integer, + shift_pressed integer, + alt_pressed integer, + meta_pressed integer, + shortcut_key text, + constraint pk_shortcuts primary key (user_id, shortcut_code), + constraint fk_shortcuts_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE +);--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_analyze',0,0,1,0,'S');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_explain',0,0,1,0,'A');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_indent',0,0,1,0,'D');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_left_inner_tab',1,0,0,0,',');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_left_outer_tab',0,0,1,0,',');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_new_inner_tab',1,0,0,0,'INSERT');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_new_outer_tab',0,0,1,0,'INSERT');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_remove_inner_tab',1,0,0,0,'END');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_remove_outer_tab',0,0,1,0,'END');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_right_inner_tab',1,0,0,0,'.');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_run_query',0,0,1,0,'Q');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_right_outer_tab',0,0,1,0,'.');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_cancel_query',0,0,1,0,'C');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_next_console_command',1,0,0,0,'ARROWDOWN');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_previous_console_command',1,0,0,0,'ARROWUP');--omnidb-- +INSERT INTO shortcuts VALUES(NULL,'shortcut_autocomplete',1,0,0,0,'SPACE');--omnidb-- + +CREATE TABLE console_history ( + user_id integer, + conn_id integer, + command_text text, + command_date text, + constraint fk_ch_users foreign key (user_id) references users (user_id) on update CASCADE on delete CASCADE, + constraint fk_ch_conn foreign key (conn_id) references connections (conn_id) on update CASCADE on delete CASCADE +);--omnidb-- + +CREATE TABLE cgroups ( + cgroup_id integer primary key, + user_id integer references users (user_id) ON UPDATE CASCADE ON DELETE CASCADE, + cgroup_name text +);--omnidb-- + +CREATE TABLE cgroups_connections ( + cgroup_id integer references cgroups (cgroup_id) ON UPDATE CASCADE ON DELETE CASCADE, + conn_id integer references connections (conn_id) ON UPDATE CASCADE ON DELETE CASCADE, + primary key (cgroup_id, conn_id) +);--omnidb-- + +CREATE TABLE version ( + ver_id text not null, + constraint pk_versions primary key (ver_id) +);--omnidb-- +INSERT INTO version VALUES('2.17.0');--omnidb-- diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB/migrations/omnidb_2.16.0_2.17.0.sql omnidb-2.17.0+ds/OmniDB/OmniDB/migrations/omnidb_2.16.0_2.17.0.sql --- omnidb-2.16.0+ds/OmniDB/OmniDB/migrations/omnidb_2.16.0_2.17.0.sql 1970-01-01 00:00:00.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB/migrations/omnidb_2.16.0_2.17.0.sql 2019-12-05 15:30:40.000000000 +0000 @@ -0,0 +1 @@ +UPDATE version SET ver_id = '2.17.0';--omnidb-- \ No newline at end of file diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB/user_database.py omnidb-2.17.0+ds/OmniDB/OmniDB/user_database.py --- omnidb-2.16.0+ds/OmniDB/OmniDB/user_database.py 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB/user_database.py 2019-12-05 15:30:40.000000000 +0000 @@ -7,7 +7,7 @@ import OmniDB_app.include.OmniDatabase as OmniDatabase migrations = { - '0.0.0': ('2.16.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_0.0.0_2.16.0.sql')), + '0.0.0': ('2.17.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_0.0.0_2.17.0.sql')), '2.4.0': ('2.4.1', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.4.0_2.4.1.sql')), '2.4.1': ('2.5.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.4.1_2.5.0.sql')), '2.5.0': ('2.6.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.5.0_2.6.0.sql')), @@ -23,6 +23,7 @@ '2.14.1': ('2.14.2', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.14.1_2.14.2.sql')), '2.14.2': ('2.15.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.14.2_2.15.0.sql')), '2.15.0': ('2.16.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.15.0_2.16.0.sql')), + '2.16.0': ('2.17.0', os.path.join(settings.BASE_DIR, 'OmniDB/migrations/omnidb_2.16.0_2.17.0.sql')), } def get_current_version(p_database): diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB/ws_core.py omnidb-2.17.0+ds/OmniDB/OmniDB/ws_core.py --- omnidb-2.16.0+ds/OmniDB/OmniDB/ws_core.py 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB/ws_core.py 2019-12-05 15:30:40.000000000 +0000 @@ -292,7 +292,6 @@ client.connect(hostname=v_conn_object['tunnel']['server'],username=v_conn_object['tunnel']['user'],key_filename=v_full_file_name,passphrase=v_conn_object['tunnel']['password'],port=int(v_conn_object['tunnel']['port'])) else: client.connect(hostname=v_conn_object['tunnel']['server'],username=v_conn_object['tunnel']['user'],password=v_conn_object['tunnel']['password'],port=int(v_conn_object['tunnel']['port'])) - tab_object['terminal_ssh_client'] = client tab_object['terminal_object'] = custom_paramiko_expect.SSHClientInteraction(client,timeout=60, display=False) tab_object['terminal_object'].send(v_data['v_cmd']) @@ -1407,6 +1406,7 @@ v_tab_id = args['v_tab_id'] v_tab_object = args['v_tab_object'] v_terminal_object = v_tab_object['terminal_object'] + v_terminal_ssh_client = v_tab_object['terminal_ssh_client'] while not self.cancel: try: @@ -1442,7 +1442,11 @@ else: if not self.cancel: ws_object.event_loop.add_callback(send_response_thread_safe,ws_object,json.dumps(v_response)) + except Exception as exc: + transport = v_terminal_ssh_client.get_transport() + if transport == None or transport.is_active() == False: + break if 'EOF' in str(exc): break diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/include/OmniDatabase/PostgreSQL.py omnidb-2.17.0+ds/OmniDB/OmniDB_app/include/OmniDatabase/PostgreSQL.py --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/include/OmniDatabase/PostgreSQL.py 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/include/OmniDatabase/PostgreSQL.py 2019-12-05 15:30:40.000000000 +0000 @@ -93,7 +93,6 @@ self.v_conn_string_error = 'Syntax error in the connection string.' None - self.v_schema = 'public' self.v_connection = Spartacus.Database.PostgreSQL(self.v_active_server, self.v_active_port, self.v_active_service, self.v_active_user, p_password, p_application_name, p_conn_string) @@ -1240,7 +1239,7 @@ select quote_ident(n.nspname) as schema_name, quote_ident(t.relname) as table_name, quote_ident(c.conname) as constraint_name, - c.consrc as constraint_source + pg_get_constraintdef(c.oid) as constraint_source from pg_constraint c join pg_class t on t.oid = c.conrelid @@ -3555,7 +3554,7 @@ quote_ident(n.nspname)::text as schema_name, quote_ident(t.relname)::text as table_name, ''::text as column_name, - c.consrc as match_value + pg_get_constraintdef(c.oid) as match_value from pg_constraint c inner join pg_class t on t.oid = c.conrelid @@ -3564,10 +3563,10 @@ where contype = 'c' and quote_ident(n.nspname) not in ('information_schema', 'omnidb', 'pg_catalog', 'pg_toast') and quote_ident(n.nspname) not like 'pg%%temp%%' - --#FILTER_PATTERN_CASE_SENSITIVE# and c.consrc like '#VALUE_PATTERN_CASE_SENSITIVE#' - --#FILTER_PATTERN_CASE_INSENSITIVE# and lower(c.consrc) like lower('#VALUE_PATTERN_CASE_INSENSITIVE#') - --#FILTER_PATTERN_REGEX_CASE_SENSITIVE# and c.consrc ~ '#VALUE_PATTERN_REGEX_CASE_SENSITIVE#' - --#FILTER_PATTERN_REGEX_CASE_INSENSITIVE# and c.consrc ~* '#VALUE_PATTERN_REGEX_CASE_INSENSITIVE#' + --#FILTER_PATTERN_CASE_SENSITIVE# and pg_get_constraintdef(c.oid) like '#VALUE_PATTERN_CASE_SENSITIVE#' + --#FILTER_PATTERN_CASE_INSENSITIVE# and lower(pg_get_constraintdef(c.oid)) like lower('#VALUE_PATTERN_CASE_INSENSITIVE#') + --#FILTER_PATTERN_REGEX_CASE_SENSITIVE# and pg_get_constraintdef(c.oid) ~ '#VALUE_PATTERN_REGEX_CASE_SENSITIVE#' + --#FILTER_PATTERN_REGEX_CASE_INSENSITIVE# and pg_get_constraintdef(c.oid) ~* '#VALUE_PATTERN_REGEX_CASE_INSENSITIVE#' --#FILTER_BY_SCHEMA# and lower(quote_ident(n.nspname)) in (#VALUE_BY_SCHEMA#) ''' @@ -4297,6 +4296,7 @@ --CHECK ( expression ) [ NO INHERIT ] --DEFAULT default_expr --GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] + --GENERATED ALWAYS AS ( generation_expr ) STORED --UNIQUE [ WITH ( storage_parameter [= value] [, ... ] ) ] [ USING INDEX TABLESPACE tablespace_name ] --PRIMARY KEY [ WITH ( storage_parameter [= value] [, ... ] ) ] [ USING INDEX TABLESPACE tablespace_name ] --REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE { NO ACTION | RESTRICT | CASCADE | SET NULL | SET DEFAULT } ] [ ON UPDATE { NO ACTION | RESTRICT | CASCADE | SET NULL | SET DEFAULT } ] @@ -4481,6 +4481,13 @@ --RESET ( storage_parameter [, ... ] ) ''') + def TemplateClusterIndex(self): + return Template('''CLUSTER +--VERBOSE +#table_name# +USING #index_name# +''') + def TemplateDropIndex(self): return Template('''DROP INDEX [ CONCURRENTLY ] #index_name# --CASCADE @@ -5121,6 +5128,7 @@ --CHECK ( expression ) --NO INHERIT --DEFAULT default_expr + --GENERATED ALWAYS AS ( generation_expr ) STORED ) --INHERITS ( parent_table [, ... ] ) SERVER server_name @@ -5367,7 +5375,7 @@ where quote_ident(n.nspname) = '{0}' and quote_ident(c.relname) = '{1}' '''.format(p_schema, p_object)) - else: + elif int(self.v_connection.ExecuteScalar('show server_version_num')) >= 110000 and int(self.v_connection.ExecuteScalar('show server_version_num')) < 120000: return self.v_connection.Query(''' select current_database() as "Database", n.nspname as "Schema", @@ -5419,6 +5427,57 @@ where quote_ident(n.nspname) = '{0}' and quote_ident(c.relname) = '{1}' '''.format(p_schema, p_object)) + else: + return self.v_connection.Query(''' + select current_database() as "Database", + n.nspname as "Schema", + c.relname as "Table", + c.oid as "OID", + r.rolname as "Owner", + pg_size_pretty(pg_relation_size(c.oid)) as "Size", + coalesce(t1.spcname, t2.spcname) as "Tablespace", + c.relacl as "ACL", + c.reloptions as "Options", + pg_relation_filepath(c.oid) as "Filenode", + c.reltuples as "Estimate Count", + c.relhasindex as "Has Index", + (case c.relpersistence when 'p' then 'Permanent' when 'u' then 'Unlogged' when 't' then 'Temporary' end) as "Persistence", + c.relnatts as "Number of Attributes", + c.relchecks as "Number of Checks", + c.relhasrules as "Has Rules", + c.relhastriggers as "Has Triggers", + c.relhassubclass as "Has Subclass", + c.relkind = 'p' as "Is Partitioned", + c.relispartition as "Is Partition", + (case when c.relispartition then po.parent_table else '' end) as "Partition Of" + from pg_class c + inner join pg_namespace n + on n.oid = c.relnamespace + inner join pg_roles r + on r.oid = c.relowner + left join pg_tablespace t1 + on t1.oid = c.reltablespace + inner join ( + select t.spcname + from pg_database d + inner join pg_tablespace t + on t.oid = d.dattablespace + where d.datname = current_database() + ) t2 + on 1 = 1 + left join ( + select quote_ident(n2.nspname) || '.' || quote_ident(c2.relname) as parent_table + from pg_inherits i + inner join pg_class c2 + on c2.oid = i.inhparent + inner join pg_namespace n2 + on n2.oid = c2.relnamespace + where i.inhrelid = '{0}.{1}'::regclass + ) po + on 1 = 1 + where quote_ident(n.nspname) = '{0}' + and quote_ident(c.relname) = '{1}' + '''.format(p_schema, p_object)) def GetPropertiesIndex(self, p_schema, p_object): return self.v_connection.Query(''' @@ -6094,7 +6153,7 @@ c.conislocal as "Is Local", c.coninhcount as "Number of Ancestors", c.connoinherit as "Non-Inheritable", - c.consrc as "Constraint Source" + pg_get_constraintdef(c.oid) as "Constraint Source" from pg_constraint c join pg_class t on t.oid = c.conrelid @@ -7223,7 +7282,7 @@ (select text from alterowner) || (select text from grants) '''.format(p_schema, p_object)) - else: + elif int(self.v_connection.ExecuteScalar('show server_version_num')) >= 100000 and int(self.v_connection.ExecuteScalar('show server_version_num')) < 110000: return self.v_connection.ExecuteScalar(''' with obj as ( SELECT c.oid, @@ -7552,6 +7611,919 @@ ), createconstraints as ( with cs as ( + select + 'ALTER TABLE ' || text(regclass(regclass)) || + ' ADD CONSTRAINT ' || quote_ident(constraint_name) || + E'\n ' || constraint_definition as sql + from constraints + order by constraint_type desc, sysid + ) + select coalesce(string_agg(sql,E';\n') || E';\n\n','') as text + from cs + ), + createindexes as ( + with ii as (select * from indexes order by name) + SELECT coalesce(string_agg(indexdef||E';\n','') || E'\n' , '') as text + FROM ii + WHERE constraint_name is null + ), + createtriggers as ( + with tg as ( + select trigger_definition as sql + from triggers where is_constraint is null + order by trigger_name + -- per SQL triggers get called in order created vs name as in PostgreSQL + ) + select coalesce(string_agg(sql,E';\n')||E';\n\n','') as text + from tg + ), + createrules as ( + select coalesce(string_agg(rule_definition,E'\n')||E'\n\n','') as text + from rules + where regclass = '{0}.{1}'::regclass + and rule_definition is not null + ), + alterowner as ( + select + case + when obj.kind in ('INDEX', 'PARTITIONED INDEX') then '' + when obj.kind = 'PARTITIONED TABLE' + then 'ALTER TABLE '||sql_identifier|| + ' OWNER TO '||quote_ident(owner)||E';\n\n' + else 'ALTER '||sql_kind||' '||sql_identifier|| + ' OWNER TO '||quote_ident(owner)||E';\n\n' + end as text + from obj + ), + privileges as ( + SELECT (u_grantor.rolname)::information_schema.sql_identifier AS grantor, + (grantee.rolname)::information_schema.sql_identifier AS grantee, + (current_database())::information_schema.sql_identifier AS table_catalog, + (nc.nspname)::information_schema.sql_identifier AS table_schema, + (c.relname)::information_schema.sql_identifier AS table_name, + (c.prtype)::information_schema.character_data AS privilege_type, + ( + CASE + WHEN (pg_has_role(grantee.oid, c.relowner, 'USAGE'::text) OR c.grantable) THEN 'YES'::text + ELSE 'NO'::text + END)::information_schema.yes_or_no AS is_grantable, + ( + CASE + WHEN (c.prtype = 'SELECT'::text) THEN 'YES'::text + ELSE 'NO'::text + END)::information_schema.yes_or_no AS with_hierarchy + FROM ( SELECT pg_class.oid, + pg_class.relname, + pg_class.relnamespace, + pg_class.relkind, + pg_class.relowner, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).grantor AS grantor, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).grantee AS grantee, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).privilege_type AS privilege_type, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).is_grantable AS is_grantable + FROM pg_class + WHERE pg_class.relkind <> 'S' + UNION + SELECT pg_class.oid, + pg_class.relname, + pg_class.relnamespace, + pg_class.relkind, + pg_class.relowner, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).grantor AS grantor, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).grantee AS grantee, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).privilege_type AS privilege_type, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).is_grantable AS is_grantable + FROM pg_class + WHERE pg_class.relkind = 'S') c(oid, relname, relnamespace, relkind, relowner, grantor, grantee, prtype, grantable), + pg_namespace nc, + pg_roles u_grantor, + ( SELECT pg_roles.oid, + pg_roles.rolname + FROM pg_roles + UNION ALL + SELECT (0)::oid AS oid, + 'PUBLIC'::name) grantee(oid, rolname) + WHERE ((c.relnamespace = nc.oid) AND (c.grantee = grantee.oid) AND (c.grantor = u_grantor.oid) + AND (c.prtype = ANY (ARRAY['INSERT'::text, 'SELECT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text, 'REFERENCES'::text, 'TRIGGER'::text])) + AND (pg_has_role(u_grantor.oid, 'USAGE'::text) OR pg_has_role(grantee.oid, 'USAGE'::text) OR (grantee.rolname = 'PUBLIC'::name))) + ), + grants as ( + select + coalesce( + string_agg(format( + E'GRANT %s ON %s TO %s%s;\n', + privilege_type, + '{0}.{1}', + case grantee + when 'PUBLIC' then 'PUBLIC' + else quote_ident(grantee) + end, + case is_grantable + when 'YES' then ' WITH GRANT OPTION' + else '' + end), ''), + '') as text + FROM privileges g + join obj on (true) + WHERE table_schema=obj.namespace + AND table_name=obj.name + AND grantee<>obj.owner + ) + select (select text from createclass) || + (select text from altertabledefaults) || + (select text from createconstraints) || + (select text from createindexes) || + (select text from createtriggers) || + (select text from createrules) || + (select text from alterowner) || + (select text from grants) + '''.format(p_schema, p_object)) + elif int(self.v_connection.ExecuteScalar('show server_version_num')) >= 110000 and int(self.v_connection.ExecuteScalar('show server_version_num')) < 120000: + return self.v_connection.ExecuteScalar(''' + with obj as ( + SELECT c.oid, + 'pg_class'::regclass, + c.relname AS name, + n.nspname AS namespace, + coalesce(cc.column2,c.relkind::text) AS kind, + pg_get_userbyid(c.relowner) AS owner, + coalesce(cc.column2,c.relkind::text) AS sql_kind, + cast('{0}.{1}'::regclass AS text) AS sql_identifier + FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace + LEFT join ( + values ('r','TABLE'), + ('v','VIEW'), + ('i','INDEX'), + ('I','PARTITIONED INDEX'), + ('S','SEQUENCE'), + ('s','SPECIAL'), + ('m','MATERIALIZED VIEW'), + ('c','TYPE'), + ('t','TOAST'), + ('f','FOREIGN TABLE'), + ('p','PARTITIONED TABLE') + ) as cc on cc.column1 = c.relkind + WHERE c.oid = '{0}.{1}'::regclass + ), + columns as ( + SELECT a.attname AS name, format_type(t.oid, NULL::integer) AS type, + CASE + WHEN (a.atttypmod - 4) > 0 THEN a.atttypmod - 4 + ELSE NULL::integer + END AS size, + a.attnotnull AS not_null, + def.adsrc AS "default", + col_description(c.oid, a.attnum::integer) AS comment, + con.conname AS primary_key, + a.attislocal AS is_local, + a.attstorage::text AS storage, + nullif(col.collcollate::text,'') AS collation, + a.attnum AS ord, + s.nspname AS namespace, + c.relname AS class_name, + format('%s.%I',text(c.oid::regclass),a.attname) AS sql_identifier, + c.oid, + format('%I %s%s%s%s', + a.attname::text, + format_type(t.oid, a.atttypmod), + CASE + WHEN length(col.collcollate) > 0 + THEN ' COLLATE ' || quote_ident(col.collcollate::text) + ELSE '' + END, + CASE + WHEN a.attnotnull THEN ' NOT NULL'::text + ELSE ''::text + END, + CASE + WHEN a.attidentity = 'a' THEN ' GENERATED ALWAYS AS IDENTITY'::text + WHEN a.attidentity = 'd' THEN ' GENERATED BY DEFAULT AS IDENTITY'::text + ELSE ''::text + END) + AS definition + FROM pg_class c + JOIN pg_namespace s ON s.oid = c.relnamespace + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_attrdef def ON c.oid = def.adrelid AND a.attnum = def.adnum + LEFT JOIN pg_constraint con + ON con.conrelid = c.oid AND (a.attnum = ANY (con.conkey)) AND con.contype = 'p' + LEFT JOIN pg_type t ON t.oid = a.atttypid + LEFT JOIN pg_collation col ON col.oid = a.attcollation + JOIN pg_namespace tn ON tn.oid = t.typnamespace + WHERE c.relkind IN ('r','v','c','f','p') AND a.attnum > 0 AND NOT a.attisdropped + AND has_table_privilege(c.oid, 'select') AND has_schema_privilege(s.oid, 'usage') + AND c.oid = '{0}.{1}'::regclass + ORDER BY s.nspname, c.relname, a.attnum + ), + comments as ( + select 'COMMENT ON COLUMN ' || text('{0}.{1}') || '.' || quote_ident(name) || + ' IS ' || quote_nullable(comment) || ';' as cc + from columns + where comment IS NOT NULL + ), + settings as ( + select 'ALTER ' || obj.kind || ' ' || text('{0}.{1}') || ' SET (' || + quote_ident(option_name)||'='||quote_nullable(option_value) ||');' as ss + from pg_options_to_table((select reloptions from pg_class where oid = '{0}.{1}'::regclass)) + join obj on (true) + ), + constraints as ( + SELECT nc.nspname AS namespace, + r.relname AS class_name, + c.conname AS constraint_name, + case c.contype + when 'c'::"char" then 'CHECK'::text + when 'f'::"char" then 'FOREIGN KEY'::text + when 'p'::"char" then 'PRIMARY KEY'::text + when 'u'::"char" then 'UNIQUE'::text + when 't'::"char" then 'TRIGGER'::text + when 'x'::"char" then 'EXCLUDE'::text + else c.contype::text + end AS constraint_type, + pg_get_constraintdef(c.oid,true) AS constraint_definition, + c.condeferrable AS is_deferrable, + c.condeferred AS initially_deferred, + r.oid as regclass, c.oid AS sysid + FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r + WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid + AND coalesce(r.oid='{0}.{1}'::regclass,true) + ), + indexes as ( + SELECT DISTINCT + c.oid AS oid, + n.nspname::text AS namespace, + c.relname::text AS class, + i.relname::text AS name, + NULL::text AS tablespace, + CASE d.refclassid + WHEN 'pg_constraint'::regclass + THEN 'ALTER TABLE ' || text(c.oid::regclass) + || ' ADD CONSTRAINT ' || quote_ident(cc.conname) + || ' ' || pg_get_constraintdef(cc.oid) + ELSE pg_get_indexdef(i.oid) + END AS indexdef, + cc.conname::text AS constraint_name + FROM pg_index x + JOIN pg_class c ON c.oid = x.indrelid + JOIN pg_namespace n ON n.oid = c.relnamespace + JOIN pg_class i ON i.oid = x.indexrelid + JOIN pg_depend d ON d.objid = x.indexrelid + LEFT JOIN pg_constraint cc ON cc.oid = d.refobjid + WHERE c.relkind in ('r','p','m') AND i.relkind in ('i'::"char", 'I'::"char") + AND coalesce(c.oid = '{0}.{1}'::regclass,true) + ), + triggers as ( + SELECT + CASE t.tgisinternal + WHEN true THEN 'CONSTRAINT'::text + ELSE NULL::text + END AS is_constraint, t.tgname::text AS trigger_name, + CASE (t.tgtype::integer & 64) <> 0 + WHEN true THEN 'INSTEAD'::text + ELSE CASE t.tgtype::integer & 2 + WHEN 2 THEN 'BEFORE'::text + WHEN 0 THEN 'AFTER'::text + ELSE NULL::text + END + END AS action_order, + array_to_string(array[ + case when (t.tgtype::integer & 4) <> 0 then 'INSERT' end, + case when (t.tgtype::integer & 8) <> 0 then 'DELETE' end, + case when (t.tgtype::integer & 16) <> 0 then 'UPDATE' end, + case when (t.tgtype::integer & 32) <> 0 then 'TRUNCATE' end + ],' OR ') AS event_manipulation, + c.oid::regclass::text AS event_object_sql_identifier, + p.oid::regprocedure::text AS action_statement, + CASE t.tgtype::integer & 1 + WHEN 1 THEN 'ROW'::text + ELSE 'STATEMENT'::text + END AS action_orientation, + pg_get_triggerdef(t.oid,true) as trigger_definition, + c.oid::regclass AS regclass, + p.oid::regprocedure AS regprocedure, + s.nspname::text AS event_object_schema, + c.relname::text AS event_object_table, + (quote_ident(t.tgname::text) || ' ON ') || c.oid::regclass::text AS sql_identifier + FROM pg_trigger t + LEFT JOIN pg_class c ON c.oid = t.tgrelid + LEFT JOIN pg_namespace s ON s.oid = c.relnamespace + LEFT JOIN pg_proc p ON p.oid = t.tgfoid + LEFT JOIN pg_namespace s1 ON s1.oid = p.pronamespace + WHERE coalesce(c.oid='{0}.{1}'::regclass,true) + ), + rules as ( + SELECT n.nspname::text AS namespace, + c.relname::text AS class_name, + r.rulename::text AS rule_name, + CASE + WHEN r.ev_type = '1'::"char" THEN 'SELECT'::text + WHEN r.ev_type = '2'::"char" THEN 'UPDATE'::text + WHEN r.ev_type = '3'::"char" THEN 'INSERT'::text + WHEN r.ev_type = '4'::"char" THEN 'DELETE'::text + ELSE 'UNKNOWN'::text + END AS rule_event, + r.is_instead, + pg_get_ruledef(r.oid, true) AS rule_definition, + c.oid::regclass AS regclass + FROM pg_rewrite r + JOIN pg_class c ON c.oid = r.ev_class + JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE coalesce(c.oid='{0}.{1}'::regclass,true) + AND NOT (r.ev_type = '1'::"char" AND r.rulename = '_RETURN'::name) + ORDER BY r.oid + ), + createview as ( + select + 'CREATE '|| + case relkind + when 'v' THEN 'OR REPLACE VIEW ' + when 'm' THEN 'MATERIALIZED VIEW ' + end || (oid::regclass::text) || E' AS\n'|| + pg_catalog.pg_get_viewdef(oid,true)||E'\n' as text + FROM pg_class t + WHERE oid = '{0}.{1}'::regclass + AND relkind in ('v','m') + ), + createtable as ( + select + 'CREATE '|| + case relpersistence + when 'u' then 'UNLOGGED ' + when 't' then 'TEMPORARY ' + else '' + end + || case obj.kind when 'PARTITIONED TABLE' then 'TABLE' else obj.kind end || ' ' || obj.sql_identifier + || case obj.kind when 'TYPE' then ' AS' else '' end + || case when c.relispartition + then + E'\n' || + (SELECT + coalesce(' PARTITION OF ' || string_agg(i.inhparent::regclass::text,', '), '') + FROM pg_inherits i WHERE i.inhrelid = '{0}.{1}'::regclass) || + E'\n'|| + coalesce(' '||( + pg_get_expr(c.relpartbound, c.oid, true) + ),'') + else + E' (\n'|| + coalesce(''||( + SELECT coalesce(string_agg(' '||definition,E',\n'),'') + FROM columns WHERE is_local + )||E'\n','')||')' + || + (SELECT + coalesce(' INHERITS(' || string_agg(i.inhparent::regclass::text,', ') || ')', '') + FROM pg_inherits i WHERE i.inhrelid = '{0}.{1}'::regclass) + end + || + case when c.relkind = 'p' + then E'\n' || ' PARTITION BY ' || pg_get_partkeydef('{0}.{1}'::regclass) + else '' end + || + CASE relhasoids WHEN true THEN ' WITH OIDS' ELSE '' END + || + coalesce( + E'\nSERVER '||quote_ident(fs.srvname) + ,'') + || + coalesce( + E'\nOPTIONS (\n'|| + (select string_agg( + ' '||quote_ident(option_name)||' '||quote_nullable(option_value), + E',\n') + from pg_options_to_table(ft.ftoptions))||E'\n)' + ,'') + || + E';\n' as text + FROM pg_class c JOIN obj ON (true) + LEFT JOIN pg_foreign_table ft ON (c.oid = ft.ftrelid) + LEFT JOIN pg_foreign_server fs ON (ft.ftserver = fs.oid) + WHERE c.oid = '{0}.{1}'::regclass + -- AND relkind in ('r','c') + ), + createsequence as ( + select + 'CREATE SEQUENCE '||(oid::regclass::text) || E';\n' + ||'ALTER SEQUENCE '||(oid::regclass::text) + ||E'\n INCREMENT BY '||increment + ||E'\n MINVALUE '||minimum_value + ||E'\n MAXVALUE '||maximum_value + ||E'\n START WITH '||start_value + ||E'\n '|| case cycle_option when 'YES' then 'CYCLE' else 'NO CYCLE' end + ||E';\n' as text + FROM information_schema.sequences s JOIN obj ON (true) + WHERE sequence_schema = obj.namespace + AND sequence_name = obj.name + AND obj.kind = 'SEQUENCE' + ), + createindex as ( + with ii as ( + SELECT DISTINCT CASE d.refclassid + WHEN 'pg_constraint'::regclass + THEN 'ALTER TABLE ' || text(c.oid::regclass) + || ' ADD CONSTRAINT ' || quote_ident(cc.conname) + || ' ' || pg_get_constraintdef(cc.oid) + ELSE pg_get_indexdef(i.oid) + END AS indexdef + FROM pg_index x + JOIN pg_class c ON c.oid = x.indrelid + JOIN pg_class i ON i.oid = x.indexrelid + JOIN pg_depend d ON d.objid = x.indexrelid + LEFT JOIN pg_constraint cc ON cc.oid = d.refobjid + WHERE c.relkind in ('r','p','m') AND i.relkind in ('i'::"char", 'I'::"char") + AND i.oid = '{0}.{1}'::regclass + ) + SELECT indexdef || E';\n' as text + FROM ii + ), + createclass as ( + select format(E'--\n-- Type: %s ; Name: %s; Owner: %s\n--\n\n', obj.kind,obj.name,obj.owner) + || + case + when obj.kind in ('VIEW','MATERIALIZED VIEW') then (select text from createview) + when obj.kind in ('TABLE','TYPE','FOREIGN TABLE','PARTITIONED TABLE') then (select text from createtable) + when obj.kind in ('SEQUENCE') then (select text from createsequence) + when obj.kind in ('INDEX', 'PARTITIONED INDEX') then (select text from createindex) + else '-- UNSUPPORTED CLASS: '||obj.kind + end + || E'\n' || + coalesce((select string_agg(cc,E'\n')||E'\n' from comments),'') + || + coalesce(E'\n'||(select string_agg(ss,E'\n')||E'\n' from settings),'') + || E'\n' as text + from obj + ), + altertabledefaults as ( + select + coalesce( + string_agg( + 'ALTER TABLE '||text('{0}.{1}')|| + ' ALTER '||quote_ident(name)|| + ' SET DEFAULT '||"default", + E';\n') || E';\n\n', + '') as text + from columns + where "default" is not null + ), + createconstraints as ( + with cs as ( + select + 'ALTER TABLE ' || text(regclass(regclass)) || + ' ADD CONSTRAINT ' || quote_ident(constraint_name) || + E'\n ' || constraint_definition as sql + from constraints + order by constraint_type desc, sysid + ) + select coalesce(string_agg(sql,E';\n') || E';\n\n','') as text + from cs + ), + createindexes as ( + with ii as (select * from indexes order by name) + SELECT coalesce(string_agg(indexdef||E';\n','') || E'\n' , '') as text + FROM ii + WHERE constraint_name is null + ), + createtriggers as ( + with tg as ( + select trigger_definition as sql + from triggers where is_constraint is null + order by trigger_name + -- per SQL triggers get called in order created vs name as in PostgreSQL + ) + select coalesce(string_agg(sql,E';\n')||E';\n\n','') as text + from tg + ), + createrules as ( + select coalesce(string_agg(rule_definition,E'\n')||E'\n\n','') as text + from rules + where regclass = '{0}.{1}'::regclass + and rule_definition is not null + ), + alterowner as ( + select + case + when obj.kind in ('INDEX', 'PARTITIONED INDEX') then '' + when obj.kind = 'PARTITIONED TABLE' + then 'ALTER TABLE '||sql_identifier|| + ' OWNER TO '||quote_ident(owner)||E';\n\n' + else 'ALTER '||sql_kind||' '||sql_identifier|| + ' OWNER TO '||quote_ident(owner)||E';\n\n' + end as text + from obj + ), + privileges as ( + SELECT (u_grantor.rolname)::information_schema.sql_identifier AS grantor, + (grantee.rolname)::information_schema.sql_identifier AS grantee, + (current_database())::information_schema.sql_identifier AS table_catalog, + (nc.nspname)::information_schema.sql_identifier AS table_schema, + (c.relname)::information_schema.sql_identifier AS table_name, + (c.prtype)::information_schema.character_data AS privilege_type, + ( + CASE + WHEN (pg_has_role(grantee.oid, c.relowner, 'USAGE'::text) OR c.grantable) THEN 'YES'::text + ELSE 'NO'::text + END)::information_schema.yes_or_no AS is_grantable, + ( + CASE + WHEN (c.prtype = 'SELECT'::text) THEN 'YES'::text + ELSE 'NO'::text + END)::information_schema.yes_or_no AS with_hierarchy + FROM ( SELECT pg_class.oid, + pg_class.relname, + pg_class.relnamespace, + pg_class.relkind, + pg_class.relowner, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).grantor AS grantor, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).grantee AS grantee, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).privilege_type AS privilege_type, + (aclexplode(COALESCE(pg_class.relacl, acldefault('r', pg_class.relowner)))).is_grantable AS is_grantable + FROM pg_class + WHERE pg_class.relkind <> 'S' + UNION + SELECT pg_class.oid, + pg_class.relname, + pg_class.relnamespace, + pg_class.relkind, + pg_class.relowner, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).grantor AS grantor, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).grantee AS grantee, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).privilege_type AS privilege_type, + (aclexplode(COALESCE(pg_class.relacl, acldefault('S', pg_class.relowner)))).is_grantable AS is_grantable + FROM pg_class + WHERE pg_class.relkind = 'S') c(oid, relname, relnamespace, relkind, relowner, grantor, grantee, prtype, grantable), + pg_namespace nc, + pg_roles u_grantor, + ( SELECT pg_roles.oid, + pg_roles.rolname + FROM pg_roles + UNION ALL + SELECT (0)::oid AS oid, + 'PUBLIC'::name) grantee(oid, rolname) + WHERE ((c.relnamespace = nc.oid) AND (c.grantee = grantee.oid) AND (c.grantor = u_grantor.oid) + AND (c.prtype = ANY (ARRAY['INSERT'::text, 'SELECT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text, 'REFERENCES'::text, 'TRIGGER'::text])) + AND (pg_has_role(u_grantor.oid, 'USAGE'::text) OR pg_has_role(grantee.oid, 'USAGE'::text) OR (grantee.rolname = 'PUBLIC'::name))) + ), + grants as ( + select + coalesce( + string_agg(format( + E'GRANT %s ON %s TO %s%s;\n', + privilege_type, + '{0}.{1}', + case grantee + when 'PUBLIC' then 'PUBLIC' + else quote_ident(grantee) + end, + case is_grantable + when 'YES' then ' WITH GRANT OPTION' + else '' + end), ''), + '') as text + FROM privileges g + join obj on (true) + WHERE table_schema=obj.namespace + AND table_name=obj.name + AND grantee<>obj.owner + ) + select (select text from createclass) || + (select text from altertabledefaults) || + (select text from createconstraints) || + (select text from createindexes) || + (select text from createtriggers) || + (select text from createrules) || + (select text from alterowner) || + (select text from grants) + '''.format(p_schema, p_object)) + else: + return self.v_connection.ExecuteScalar(''' + with obj as ( + SELECT c.oid, + 'pg_class'::regclass, + c.relname AS name, + n.nspname AS namespace, + coalesce(cc.column2,c.relkind::text) AS kind, + pg_get_userbyid(c.relowner) AS owner, + coalesce(cc.column2,c.relkind::text) AS sql_kind, + cast('{0}.{1}'::regclass AS text) AS sql_identifier + FROM pg_class c JOIN pg_namespace n ON n.oid=c.relnamespace + LEFT join ( + values ('r','TABLE'), + ('v','VIEW'), + ('i','INDEX'), + ('I','PARTITIONED INDEX'), + ('S','SEQUENCE'), + ('s','SPECIAL'), + ('m','MATERIALIZED VIEW'), + ('c','TYPE'), + ('t','TOAST'), + ('f','FOREIGN TABLE'), + ('p','PARTITIONED TABLE') + ) as cc on cc.column1 = c.relkind + WHERE c.oid = '{0}.{1}'::regclass + ), + columns as ( + SELECT a.attname AS name, format_type(t.oid, NULL::integer) AS type, + CASE + WHEN (a.atttypmod - 4) > 0 THEN a.atttypmod - 4 + ELSE NULL::integer + END AS size, + a.attnotnull AS not_null, + a.attgenerated AS generated, + pg_get_expr(def.adbin, def.adrelid) AS "default", + col_description(c.oid, a.attnum::integer) AS comment, + con.conname AS primary_key, + a.attislocal AS is_local, + a.attstorage::text AS storage, + nullif(col.collcollate::text,'') AS collation, + a.attnum AS ord, + s.nspname AS namespace, + c.relname AS class_name, + format('%s.%I',text(c.oid::regclass),a.attname) AS sql_identifier, + c.oid, + format('%I %s%s%s%s', + a.attname::text, + format_type(t.oid, a.atttypmod), + CASE + WHEN length(col.collcollate) > 0 + THEN ' COLLATE ' || quote_ident(col.collcollate::text) + ELSE '' + END, + CASE + WHEN a.attnotnull THEN ' NOT NULL'::text + ELSE ''::text + END, + CASE + WHEN a.attidentity = 'a' THEN ' GENERATED ALWAYS AS IDENTITY'::text + WHEN a.attidentity = 'd' THEN ' GENERATED BY DEFAULT AS IDENTITY'::text + WHEN a.attgenerated = 's' THEN format(' GENERATED ALWAYS AS %s STORED',pg_get_expr(def.adbin, def.adrelid))::text + ELSE ''::text + END) + AS definition + FROM pg_class c + JOIN pg_namespace s ON s.oid = c.relnamespace + JOIN pg_attribute a ON c.oid = a.attrelid + LEFT JOIN pg_attrdef def ON c.oid = def.adrelid AND a.attnum = def.adnum + LEFT JOIN pg_constraint con + ON con.conrelid = c.oid AND (a.attnum = ANY (con.conkey)) AND con.contype = 'p' + LEFT JOIN pg_type t ON t.oid = a.atttypid + LEFT JOIN pg_collation col ON col.oid = a.attcollation + JOIN pg_namespace tn ON tn.oid = t.typnamespace + WHERE c.relkind IN ('r','v','c','f','p') AND a.attnum > 0 AND NOT a.attisdropped + AND has_table_privilege(c.oid, 'select') AND has_schema_privilege(s.oid, 'usage') + AND c.oid = '{0}.{1}'::regclass + ORDER BY s.nspname, c.relname, a.attnum + ), + comments as ( + select 'COMMENT ON COLUMN ' || text('{0}.{1}') || '.' || quote_ident(name) || + ' IS ' || quote_nullable(comment) || ';' as cc + from columns + where comment IS NOT NULL + ), + settings as ( + select 'ALTER ' || obj.kind || ' ' || text('{0}.{1}') || ' SET (' || + quote_ident(option_name)||'='||quote_nullable(option_value) ||');' as ss + from pg_options_to_table((select reloptions from pg_class where oid = '{0}.{1}'::regclass)) + join obj on (true) + ), + constraints as ( + SELECT nc.nspname AS namespace, + r.relname AS class_name, + c.conname AS constraint_name, + case c.contype + when 'c'::"char" then 'CHECK'::text + when 'f'::"char" then 'FOREIGN KEY'::text + when 'p'::"char" then 'PRIMARY KEY'::text + when 'u'::"char" then 'UNIQUE'::text + when 't'::"char" then 'TRIGGER'::text + when 'x'::"char" then 'EXCLUDE'::text + else c.contype::text + end AS constraint_type, + pg_get_constraintdef(c.oid,true) AS constraint_definition, + c.condeferrable AS is_deferrable, + c.condeferred AS initially_deferred, + r.oid as regclass, c.oid AS sysid + FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r + WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid + AND coalesce(r.oid='{0}.{1}'::regclass,true) + ), + indexes as ( + SELECT DISTINCT + c.oid AS oid, + n.nspname::text AS namespace, + c.relname::text AS class, + i.relname::text AS name, + NULL::text AS tablespace, + CASE d.refclassid + WHEN 'pg_constraint'::regclass + THEN 'ALTER TABLE ' || text(c.oid::regclass) + || ' ADD CONSTRAINT ' || quote_ident(cc.conname) + || ' ' || pg_get_constraintdef(cc.oid) + ELSE pg_get_indexdef(i.oid) + END AS indexdef, + cc.conname::text AS constraint_name + FROM pg_index x + JOIN pg_class c ON c.oid = x.indrelid + JOIN pg_namespace n ON n.oid = c.relnamespace + JOIN pg_class i ON i.oid = x.indexrelid + JOIN pg_depend d ON d.objid = x.indexrelid + LEFT JOIN pg_constraint cc ON cc.oid = d.refobjid + WHERE c.relkind in ('r','p','m') AND i.relkind in ('i'::"char", 'I'::"char") + AND coalesce(c.oid = '{0}.{1}'::regclass,true) + ), + triggers as ( + SELECT + CASE t.tgisinternal + WHEN true THEN 'CONSTRAINT'::text + ELSE NULL::text + END AS is_constraint, t.tgname::text AS trigger_name, + CASE (t.tgtype::integer & 64) <> 0 + WHEN true THEN 'INSTEAD'::text + ELSE CASE t.tgtype::integer & 2 + WHEN 2 THEN 'BEFORE'::text + WHEN 0 THEN 'AFTER'::text + ELSE NULL::text + END + END AS action_order, + array_to_string(array[ + case when (t.tgtype::integer & 4) <> 0 then 'INSERT' end, + case when (t.tgtype::integer & 8) <> 0 then 'DELETE' end, + case when (t.tgtype::integer & 16) <> 0 then 'UPDATE' end, + case when (t.tgtype::integer & 32) <> 0 then 'TRUNCATE' end + ],' OR ') AS event_manipulation, + c.oid::regclass::text AS event_object_sql_identifier, + p.oid::regprocedure::text AS action_statement, + CASE t.tgtype::integer & 1 + WHEN 1 THEN 'ROW'::text + ELSE 'STATEMENT'::text + END AS action_orientation, + pg_get_triggerdef(t.oid,true) as trigger_definition, + c.oid::regclass AS regclass, + p.oid::regprocedure AS regprocedure, + s.nspname::text AS event_object_schema, + c.relname::text AS event_object_table, + (quote_ident(t.tgname::text) || ' ON ') || c.oid::regclass::text AS sql_identifier + FROM pg_trigger t + LEFT JOIN pg_class c ON c.oid = t.tgrelid + LEFT JOIN pg_namespace s ON s.oid = c.relnamespace + LEFT JOIN pg_proc p ON p.oid = t.tgfoid + LEFT JOIN pg_namespace s1 ON s1.oid = p.pronamespace + WHERE coalesce(c.oid='{0}.{1}'::regclass,true) + ), + rules as ( + SELECT n.nspname::text AS namespace, + c.relname::text AS class_name, + r.rulename::text AS rule_name, + CASE + WHEN r.ev_type = '1'::"char" THEN 'SELECT'::text + WHEN r.ev_type = '2'::"char" THEN 'UPDATE'::text + WHEN r.ev_type = '3'::"char" THEN 'INSERT'::text + WHEN r.ev_type = '4'::"char" THEN 'DELETE'::text + ELSE 'UNKNOWN'::text + END AS rule_event, + r.is_instead, + pg_get_ruledef(r.oid, true) AS rule_definition, + c.oid::regclass AS regclass + FROM pg_rewrite r + JOIN pg_class c ON c.oid = r.ev_class + JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE coalesce(c.oid='{0}.{1}'::regclass,true) + AND NOT (r.ev_type = '1'::"char" AND r.rulename = '_RETURN'::name) + ORDER BY r.oid + ), + createview as ( + select + 'CREATE '|| + case relkind + when 'v' THEN 'OR REPLACE VIEW ' + when 'm' THEN 'MATERIALIZED VIEW ' + end || (oid::regclass::text) || E' AS\n'|| + pg_catalog.pg_get_viewdef(oid,true)||E'\n' as text + FROM pg_class t + WHERE oid = '{0}.{1}'::regclass + AND relkind in ('v','m') + ), + createtable as ( + select + 'CREATE '|| + case relpersistence + when 'u' then 'UNLOGGED ' + when 't' then 'TEMPORARY ' + else '' + end + || case obj.kind when 'PARTITIONED TABLE' then 'TABLE' else obj.kind end || ' ' || obj.sql_identifier + || case obj.kind when 'TYPE' then ' AS' else '' end + || case when c.relispartition + then + E'\n' || + (SELECT + coalesce(' PARTITION OF ' || string_agg(i.inhparent::regclass::text,', '), '') + FROM pg_inherits i WHERE i.inhrelid = '{0}.{1}'::regclass) || + E'\n'|| + coalesce(' '||( + pg_get_expr(c.relpartbound, c.oid, true) + ),'') + else + E' (\n'|| + coalesce(''||( + SELECT coalesce(string_agg(' '||definition,E',\n'),'') + FROM columns WHERE is_local + )||E'\n','')||')' + || + (SELECT + coalesce(' INHERITS(' || string_agg(i.inhparent::regclass::text,', ') || ')', '') + FROM pg_inherits i WHERE i.inhrelid = '{0}.{1}'::regclass) + end + || + case when c.relkind = 'p' + then E'\n' || ' PARTITION BY ' || pg_get_partkeydef('{0}.{1}'::regclass) + else '' end + || + coalesce( + E'\nSERVER '||quote_ident(fs.srvname) + ,'') + || + coalesce( + E'\nOPTIONS (\n'|| + (select string_agg( + ' '||quote_ident(option_name)||' '||quote_nullable(option_value), + E',\n') + from pg_options_to_table(ft.ftoptions))||E'\n)' + ,'') + || + E';\n' as text + FROM pg_class c JOIN obj ON (true) + LEFT JOIN pg_foreign_table ft ON (c.oid = ft.ftrelid) + LEFT JOIN pg_foreign_server fs ON (ft.ftserver = fs.oid) + WHERE c.oid = '{0}.{1}'::regclass + -- AND relkind in ('r','c') + ), + createsequence as ( + select + 'CREATE SEQUENCE '||(oid::regclass::text) || E';\n' + ||'ALTER SEQUENCE '||(oid::regclass::text) + ||E'\n INCREMENT BY '||increment + ||E'\n MINVALUE '||minimum_value + ||E'\n MAXVALUE '||maximum_value + ||E'\n START WITH '||start_value + ||E'\n '|| case cycle_option when 'YES' then 'CYCLE' else 'NO CYCLE' end + ||E';\n' as text + FROM information_schema.sequences s JOIN obj ON (true) + WHERE sequence_schema = obj.namespace + AND sequence_name = obj.name + AND obj.kind = 'SEQUENCE' + ), + createindex as ( + with ii as ( + SELECT DISTINCT CASE d.refclassid + WHEN 'pg_constraint'::regclass + THEN 'ALTER TABLE ' || text(c.oid::regclass) + || ' ADD CONSTRAINT ' || quote_ident(cc.conname) + || ' ' || pg_get_constraintdef(cc.oid) + ELSE pg_get_indexdef(i.oid) + END AS indexdef + FROM pg_index x + JOIN pg_class c ON c.oid = x.indrelid + JOIN pg_class i ON i.oid = x.indexrelid + JOIN pg_depend d ON d.objid = x.indexrelid + LEFT JOIN pg_constraint cc ON cc.oid = d.refobjid + WHERE c.relkind in ('r','p','m') AND i.relkind in ('i'::"char", 'I'::"char") + AND i.oid = '{0}.{1}'::regclass + ) + SELECT indexdef || E';\n' as text + FROM ii + ), + createclass as ( + select format(E'--\n-- Type: %s ; Name: %s; Owner: %s\n--\n\n', obj.kind,obj.name,obj.owner) + || + case + when obj.kind in ('VIEW','MATERIALIZED VIEW') then (select text from createview) + when obj.kind in ('TABLE','TYPE','FOREIGN TABLE','PARTITIONED TABLE') then (select text from createtable) + when obj.kind in ('SEQUENCE') then (select text from createsequence) + when obj.kind in ('INDEX', 'PARTITIONED INDEX') then (select text from createindex) + else '-- UNSUPPORTED CLASS: '||obj.kind + end + || E'\n' || + coalesce((select string_agg(cc,E'\n')||E'\n' from comments),'') + || + coalesce(E'\n'||(select string_agg(ss,E'\n')||E'\n' from settings),'') + || E'\n' as text + from obj + ), + altertabledefaults as ( + select + coalesce( + string_agg( + 'ALTER TABLE '||text('{0}.{1}')|| + ' ALTER '||quote_ident(name)|| + ' SET DEFAULT '||"default", + E';\n') || E';\n\n', + '') as text + from columns + where "default" is not null + and generated = '' + ), + createconstraints as ( + with cs as ( select 'ALTER TABLE ' || text(regclass(regclass)) || ' ADD CONSTRAINT ' || quote_ident(constraint_name) || diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/grid-icon.css omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/grid-icon.css --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/grid-icon.css 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/grid-icon.css 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ i.action-grid { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/interface-icon.css omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/interface-icon.css --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/interface-icon.css 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/interface-icon.css 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ .fa-light { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/login.css omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/login.css --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/login.css 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/login.css 2019-12-05 15:30:40.000000000 +0000 @@ -1,35 +1,27 @@ html { - position: relative; height: 100%; - height: 100vh; } body { - position: relative; margin: 0px; height: 100%; - height: 100vh; font-family: monospace; background-color: #F2F2F2; } #div_form { - position: absolute; - display: table; - top: 10%; - bottom: 10%; - right: 0; - left: 0; - width: 280px; - max-width: 100%; - margin: auto; - box-sizing: border-box; - background-color: #FFFFFF; - box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.07); - border-radius: 3px; + display: flex; + align-items: center; + justify-content: center; + + height: 100%; } #div_form .loginWrap { - display: inline-block; padding: 10px; + width: 280px; text-align: center; + background-color: #FFFFFF; + box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.07); + border-radius: 3px; + box-sizing: border-box; } #div_form .div_time { display: inline-block; @@ -37,6 +29,7 @@ #div_form .version { padding-right: 34px; text-align: right; + color: #828282; } #div_form small { display: inline-block: @@ -44,7 +37,7 @@ #div_form .inputWrap { position: relative; display: block; - margin: 30px 0px; + margin: 20px 0px; padding-top: 2px; padding-bottom: 2px; background-color: #FFFFFF; @@ -91,7 +84,7 @@ button { display: inline-block; padding: 6px 10px; - font-size: 22px; + font-size: 18px; border: none; color: #FFFFFF; background-color: #839ec7; @@ -155,3 +148,106 @@ .isModal.isActive { display: block; } + + + +/** ANIMATIONS **/ +#div_form { + opacity: 0; + + animation: fadeIn 0.3s linear forwards 0s; +} + +#div_form .loginWrap-body { + height: 0px; + overflow: hidden; + + animation: growInFromTop 0.4s linear forwards 1.4s; +} + +#div_form .version, +#div_form .inputWrap, +#div_form button { + opacity: 0; + + animation: fadeIn 0.6s linear forwards 1.8s; +} + +#div_form .inputWrap { + overflow: hidden; +} +#div_form .inputWrap label { + transform: translateX(260px); + +} +#user_title { + animation: slideInFromRight 0.45s ease forwards 2s; +} +#pwd_title { + animation: slideInFromRight 0.45s ease forwards 2.1s; +} + +/* Animated Logo Omnidb styles */ +#div_time .logo svg { + width: 220px; +} + +.logo_omnidb path, +.logo_omnidb rect { + fill: transparent; + stroke: #818181; + stroke-width: 1px; + + stroke-dasharray: 100; + stroke-dashoffset: 100; +} + +.logo_omnidb_to-blue path, +.logo_omnidb_to-blue rect { + animation: svgDrawStrokes 1s linear forwards 0.3s, + svgToBlue 0.6s linear forwards 1.3s, + svgFadeStrokes 0.6s linear forwards 1.3s; +} + +.logo_omnidb_to-darkblue path, +.logo_omnidb_to-darkblue rect { + animation: svgDrawStrokes 1s linear forwards 0.3s, + svgToDarkblue 0.6s linear forwards 1.3s, + svgFadeStrokes 0.6s linear forwards 1.3s; +} + +@keyframes svgDrawStrokes { + to { + stroke-dashoffset: 0; + } +} +@keyframes svgFadeStrokes { + to { + stroke: transparent; + } +} +@keyframes svgToBlue { + to { + fill: #878FC6; + } +} +@keyframes svgToDarkblue { + to { + fill: #515579; + } +} +@keyframes fadeIn { + to { + opacity: 1; + } +} +@keyframes slideInFromRight { + to { + transform: translateX(0); + } +} +@keyframes growInFromTop { + to { + height: 187px; + } +} diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/modern-style.css omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/modern-style.css --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/modern-style.css 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/modern-style.css 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /* TYPOGRAPHY */ diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/node-icon.css omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/node-icon.css --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/node-icon.css 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/node-icon.css 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ .node-all { color: #22477d; diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/style.css omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/style.css --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/style.css 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/css/style.css 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ html { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AjaxControl.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AjaxControl.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AjaxControl.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AjaxControl.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ //Number of active AJAX calls diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AlterTable.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AlterTable.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AlterTable.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/AlterTable.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /** diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Autocomplete.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Autocomplete.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Autocomplete.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Autocomplete.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ var v_autocomplete_object; diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CommandHistory.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CommandHistory.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CommandHistory.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CommandHistory.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Connections.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Connections.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Connections.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Connections.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Console.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Console.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Console.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Console.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Conversions.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Conversions.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Conversions.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Conversions.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateConversion.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateConversion.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateConversion.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateConversion.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateTabFunctions.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateTabFunctions.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateTabFunctions.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CreateTabFunctions.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ function initCreateTabFunctions() { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CustomMenu.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CustomMenu.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CustomMenu.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/CustomMenu.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ function customMenu(p_position,p_menu,p_object) { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Debug.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Debug.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Debug.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Debug.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/EditData.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/EditData.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/EditData.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/EditData.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/HeaderActions.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/HeaderActions.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/HeaderActions.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/HeaderActions.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ var v_light_terminal_theme = { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/MonitorDashboard.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/MonitorDashboard.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/MonitorDashboard.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/MonitorDashboard.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ function closeMonitorUnit(p_div) { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Monitoring.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Monitoring.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Monitoring.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Monitoring.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/NotificationControl.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/NotificationControl.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/NotificationControl.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/NotificationControl.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ function checkSessionMessage() { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/PluginHook.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/PluginHook.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/PluginHook.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/PluginHook.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /* diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/QueryClient.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/QueryClient.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/QueryClient.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/QueryClient.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// @@ -58,6 +71,7 @@ //Ping timer var v_client_ping_timer = null; +var v_client_ping_response_timer = null; /// /// The variable that will receive the WebSocket object. @@ -84,9 +98,9 @@ // function websocketPing() { - setTimeout( function() { + v_client_ping_timer = setTimeout( function() { sendWebSocketMessage(v_queryWebSocket, v_queryRequestCodes.Ping, null, false); - v_client_ping_timer = setTimeout(function() { + v_client_ping_response_timer = setTimeout(function() { try { v_queryWebSocket.close(); } @@ -101,12 +115,8 @@ function websocketPong() { clearTimeout(v_client_ping_timer); - setTimeout( function() { - sendWebSocketMessage(v_queryWebSocket, v_queryRequestCodes.Ping, null, false); - v_client_ping_timer = setTimeout(function() { - websocketClosed(); - },20000); - },120000); + clearTimeout(v_client_ping_response_timer); + websocketPing(); } @@ -116,6 +126,10 @@ /// Port where chat will listen for connections. function startQueryWebSocket(p_port) { + clearTimeout(v_client_ping_timer); + clearTimeout(v_client_ping_response_timer); + + setStatusIcon(1); var v_address = ''; diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Query.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Query.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Query.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Query.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Renderers.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Renderers.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Renderers.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Renderers.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ function blueHtmlRenderer(instance, td, row, col, prop, value, cellProperties) { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Shortcuts.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Shortcuts.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Shortcuts.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Shortcuts.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ //Initializing shortcut buttons diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Terminal.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Terminal.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Terminal.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Terminal.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Tree.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Tree.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Tree.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Tree.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMariadb.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMariadb.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMariadb.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMariadb.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMonitor.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMonitor.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMonitor.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMonitor.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMysql.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMysql.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMysql.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeMysql.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeOracle.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeOracle.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeOracle.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeOracle.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreePostgresql.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreePostgresql.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreePostgresql.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreePostgresql.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ function tabSQLTemplate(p_tab_name, p_template, p_showTip=true) { @@ -32,7 +45,7 @@ } } -function tabAdvancedObjectSearch(node) { +function tabAdvancedObjectSearch(p_majorVersion) { var v_name = 'Advanced Object Search'; v_connTabControl.selectedTab.tag.tabControl.removeTabIndex(v_connTabControl @@ -208,7 +221,7 @@ v_optionsContainerDiv.style.padding = '10px'; v_containerDiv.appendChild(v_optionsContainerDiv); - if (parseInt(getMajorVersionPostgresql(node.tree.tag.version)) >= 10) { + if (p_majorVersion >= 10) { var v_optionList = [{ 'text': 'Data', 'value': 1 @@ -331,7 +344,7 @@ 'value': 40 } ]; - } else if (parseInt(getMajorVersionPostgresql(node.tree.tag.version)) >= 10) { + } else if (p_majorVersion >= 10) { var v_optionList = [{ 'text': 'Data', 'value': 1 @@ -1057,10 +1070,10 @@ } }, { text: 'Advanced Object Search', - icon: 'fas cm-all fa-search', + icon: 'fas cm-all fa-binoculars', action: function(node) { checkCurrentDatabase(node, true, function() { - tabAdvancedObjectSearch(node); + tabAdvancedObjectSearch(parseInt(getMajorVersionPostgresql(node.tree.tag.version))); }, function() { node.collapseNode(); }) @@ -1791,6 +1804,19 @@ ''))); } }, { + text: 'Cluster Index', + icon: 'fas cm-all fa-edit', + action: function(node) { + tabSQLTemplate('Cluster Index', node.tree.tag + .cluster_index.replace( + '#table_name#', node.tag.schema + '.' + node.parent.parent + .text).replace('#index_name#', + node.tag.schema + '.' + + node.text.replace(' (Unique)', + '').replace(' (Non Unique)', + ''))); + } + }, { text: 'Drop Index', icon: 'fas cm-all fa-times', action: function(node) { @@ -2487,7 +2513,7 @@ action: function(node) { tabSQLTemplate('Create Event Trigger Function', node.tree.tag.create_eventtriggerfunction - .replace('#schema_name#', nnode.tag.schema)); + .replace('#schema_name#', node.tag.schema)); } }, { text: 'Doc: Event Trigger Functions', @@ -4181,6 +4207,7 @@ drop_foreignkey: p_return.v_data.v_database_return.drop_foreignkey, create_index: p_return.v_data.v_database_return.create_index, alter_index: p_return.v_data.v_database_return.alter_index, + cluster_index: p_return.v_data.v_database_return.cluster_index, drop_index: p_return.v_data.v_database_return.drop_index, create_check: p_return.v_data.v_database_return.create_check, drop_check: p_return.v_data.v_database_return.drop_check, diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeSnippets.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeSnippets.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeSnippets.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/TreeSnippets.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Users.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Users.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Users.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Users.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/WebSocketControl.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/WebSocketControl.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/WebSocketControl.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/WebSocketControl.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /// diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Workspace.js omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Workspace.js --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Workspace.js 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/static/OmniDB_app/js/Workspace.js 2019-12-05 15:30:40.000000000 +0000 @@ -1,13 +1,26 @@ /* -Copyright 2015-2017 The OmniDB Team +The MIT License (MIT) -This file is part of OmniDB. +Portions Copyright (c) 2015-2019, The OmniDB Team +Portions Copyright (c) 2017-2019, 2ndQuadrant Limited -OmniDB is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -OmniDB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with OmniDB. If not, see http://www.gnu.org/licenses/. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ var v_browserTabActive = true; @@ -41,27 +54,14 @@
    -
  • Monitoring Dashboard: Graph monitor unit type
  • -
  • Monitoring Dashboard: New standard units: TPS, WAL Production and Replication Graph
  • -
  • PostgreSQL TreeView: New groups for partitioned and inherited tables
  • -
  • PostgreSQL Debugger Plugin: Support for PostgreSQL running on OSX
  • -
  • Server: Support to run OmniDB on a custom URL path
  • -
  • Snippets: Run Snippet in Connection
  • -
  • Add Connection list in (+) menu of outer tabs
  • -
  • Show red X on tabs only on mouse hover
  • -
  • Color icons in Dark Theme
  • -
  • Release Notes outer tab now stay closed and only open upon next upgrade
  • -
  • Included procedures in Advanced Object Search for PostgreSQL 11
  • -
  • OmniDB server and PostgreSQL debugger plugin packages under Debian PGDG repository (thanks to Christoph Berg @df7cb )
  • -
  • Fixed #768: Monitoring - some units fail on a standby server
  • -
  • Fixed #836: SELECT ... INTO is not allowed here
  • -
  • Fixed #845: Partitioned relation indexes
  • -
  • Fixed #938: Password in connection string not used
  • -
  • Fixed #940: Unable to change column width of query results
  • -
  • Fixed #960: Snippet TreeView not rendering properly
  • -
  • Fixed #970: Focus on change Query Tab names
  • -
  • Fixed #981: Updatable chart titles
  • -
  • Fixed #990: Cleanup of inactive web socket clients
  • +
  • Support to PostgreSQL 12.
  • +
  • Table DDL panel shows generated columns.
  • +
  • Added SQL template for Cluster Index, accessible from context menu in TreeView.
  • +
  • Added Advanced Object Search as an option in Inner Tab context menu.
  • +
  • Fixed: Server ping causing peaks of false positives in moments of brief network interruption or idle activities, or when the notebook running OmniDB was put to sleep.
  • +
  • Fixed: High CPU usage when SSH console is being used and tunnel gets closed.
  • +
  • Fixed: Render issue with graph chart type.
  • +
  • Fixed: Permission issue to install OmniDB plugins on Linux.
@@ -1575,6 +1575,41 @@ } ] + if (v_connTabControl.selectedTab.tag.selectedDBMS == 'postgresql') { + var v_openTabAdvancedObjectSearch = function() { + execAjax('/get_postgresql_version/', + JSON.stringify({ + 'p_database_index': v_connTabControl.selectedTab.tag.selectedDatabaseIndex, + 'p_tab_id': v_connTabControl.selectedTab.id + }), + function(p_return) { + tabAdvancedObjectSearch(parseInt(getMajorVersionPostgresql(p_return.v_data.v_version))); + }, + function(p_return) { + if (p_return.v_data.password_timeout) { + showPasswordPrompt( + v_connTabControl.selectedTab.tag.selectedDatabaseIndex, + function() { + v_openTabAdvancedObjectSearch(); + }, + null, + p_return.v_data.message + ); + } + }, + 'box' + ); + }; + + v_option_list.push( + { + text: 'Advanced Object Search', + icon: 'fas cm-all fa-binoculars', + action: v_openTabAdvancedObjectSearch + } + ); + } + if (v_connTabControl.selectedTab.tag.selectedDBMS=='postgresql' || v_connTabControl.selectedTab.tag.selectedDBMS=='mysql' || v_connTabControl.selectedTab.tag.selectedDBMS=='mariadb') { diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/animated_assets/animated_logo_omnidb.svg omnidb-2.17.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/animated_assets/animated_logo_omnidb.svg --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/animated_assets/animated_logo_omnidb.svg 1970-01-01 00:00:00.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/animated_assets/animated_logo_omnidb.svg 2019-12-05 15:30:40.000000000 +0000 @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru omnidb-2.16.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/base.html omnidb-2.17.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/base.html --- omnidb-2.16.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/base.html 2019-06-13 13:35:47.000000000 +0000 +++ omnidb-2.17.0+ds/OmniDB/OmniDB_app/templates/OmniDB_app/base.html 2019-12-05 15:30:40.000000000 +0000 @@ -5,14 +5,14 @@ - + - + - - - - + + + + @@ -594,32 +594,32 @@
- - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +