Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrateDB: Subtract features from PostgreSQL adapter to make CrateDB work #38

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/metabase/driver/postgres.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,18 @@
(defmethod driver/display-name :postgres [_] "PostgreSQL")

;; Features that are supported by Postgres and all of its child drivers like Redshift
(doseq [[feature supported?] {:connection-impersonation true
:describe-fields true
:describe-fks true
:convert-timezone true
:datetime-diff true
(doseq [[feature supported?] {:connection-impersonation false
:describe-fields false
:describe-fks false
:convert-timezone false
:datetime-diff false
:now true
:persist-models true
:schemas true
:identifiers-with-spaces true
:uuid-type true
:uploads true}]
:identifiers-with-spaces false
:uuid-type false
:table-privileges false
:uploads false}]
(defmethod driver/database-supports? [:postgres feature] [_driver _feature _db] supported?))

(defmethod driver/database-supports? [:postgres :nested-field-columns]
Expand All @@ -80,7 +81,6 @@
;; Features that are supported by postgres only
(doseq [feature [:actions
:actions/custom
:table-privileges
:index-info]]
(defmethod driver/database-supports? [:postgres feature]
[driver _feat _db]
Expand Down Expand Up @@ -231,11 +231,11 @@
:else nil]
:type]
[:d.description :description]
[:stat.n_live_tup :estimated_row_count]]
]
:from [[:pg_catalog.pg_class :c]]
:join [[:pg_catalog.pg_namespace :n] [:= :c.relnamespace :n.oid]]
:left-join [[:pg_catalog.pg_description :d] [:and [:= :c.oid :d.objoid] [:= :d.objsubid 0] [:= :d.classoid [:raw "'pg_class'::regclass"]]]
[:pg_stat_user_tables :stat] [:and [:= :n.nspname :stat.schemaname] [:= :c.relname :stat.relname]]]
]
:where [:and [:= :c.relnamespace :n.oid]
;; filter out system tables
[(keyword "!~") :n.nspname "^pg_"] [:<> :n.nspname "information_schema"]
Expand Down
Loading