     (-> (sel :one Table :id 100)
         korma-entity
         (select (aggregate (count :*) :count)))"
-  ([table]
-   (korma-entity (table/database table) table))
-
-  ([db table]             (table+db->entity table (db->korma-db db)))
-  ([driver details table] (table+db->entity table (db->korma-db driver details))))
+  ([table]    (korma-entity (table/database table) table))
+  ([db table] (let [{schema :schema, table-name :name} table]
+                (k/database
+                  (kx/create-entity [schema table-name])
+                  (db->korma-db db)))))


     Return `nil` to prevent FIELD from being aliased.")

  (get-connection-for-sync ^java.sql.Connection [this details]
    "*OPTIONAL*. Get a connection used for a Sync step. By default, this returns a pooled connection.")

  (prepare-value [this, ^Value value]
    "*OPTIONAL*. Prepare a value (e.g. a `String` or `Integer`) that will be used in a korma form. By default, this returns VALUE's `:value` as-is, which
     is eventually passed as a parameter in a prepared statement. Drivers such as BigQuery that don't support prepared statements can skip this

   :current-datetime-fn     (constantly (k/sqlfn* :NOW))
   :excluded-schemas        (constantly nil)
   :field->alias            (u/drop-first-arg name)
   :prepare-value           (u/drop-first-arg :value)
   :set-timezone-sql        (constantly nil)
   :stddev-fn               (constantly :STDDEV)})
