Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 14, 2023
  2. Aug 10, 2023
    • lbrdnk's avatar
      Modify `:contains`, `:starts-with` and `:ends-with` so field or expression can... · a98bfa1f
      lbrdnk authored
      Modify `:contains`, `:starts-with` and `:ends-with` so field or expression can be used as the second argument (#32446)
      
      * Update `LIKE` to handle fields and expressions
      
      Previously only string could be used with like clause, ie. as second
      argument of `:starts-with`, `:ends-with` or `:contains`. This commit modifies
      translation of those functions, so fields or expressions can be
      used in place of second argument.
      
      * Make only expression or field args use `concat`
      
      Using concat with values unnecessarily complects generated sql.
      
      * Update tests
      
      * Extend mongo string matching capabilities
      
      Make mongo filter compilation use `$regexMatch` for `:contains`,
      `:starts-with` and `:ends-with` so expressions and fields
      can be matched against.
      
      * Adjust mongo specific tests
      
      * Update druid
      
      Druid's filters work with `:contains`, `:starts-with` and `:ends-with`,
      but only if second argument is literal pattern. This commit updates
      existing code, so expection is thrown if `pattern` has different form
      than `[:value ...]`.
      
      * Address review comments - sql
      
      * Address review comments - mongo
      
      * Use mbql `:concat` instead of `hx/call :concat`
      
      Vertica, orcacle and sqlite handle concat differently than other
      drivers. To overcome this limitation, `pre`, `post` and `arg` are
      wrapped into mbql's concat expression which is then translated
      with regards to the specifics of particular driver.
      
      * Update according to the review feedback
      
      ---------
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Unverified
      a98bfa1f
    • lbrdnk's avatar
      Update mongo native param substitution (#33003) · 88b9ee0f
      lbrdnk authored
      
      Change is compatible with prior implementation. Match clause like
      the following, `{$match: {"something": "Facebook"}}`, does exact match
      if `something` is a scalar, and in case `something` was an array, match
      would check whether it contains the `Facebook` value. Same behavior,
      as with `{$match: {"something": {$in: ["Facebook"]}}}`.
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Unverified
      88b9ee0f
  3. Aug 09, 2023
  4. Aug 06, 2023
    • Cam Saul's avatar
      QP: use Malli (#32657) · 18c1b198
      Cam Saul authored
      * QP: use Malli
      
      * Fix schema names
      
      * Fix missing namespaces
      
      * Fix busted stuff
      
      * Simplify the new schema
      
      * Test fix :wrench:
      
      * Test fixes :wrench:
      
      * MongoDB fixes :wrench:
      
      * FAST mu/defn
      
      * Malli registry
      
      * Misc fixes
      
      * Some cleanup
      
      * Misc cleanup and test fixes :wrench:
      
      * mu/disable-enforcement
      
      * Test fix
      
      * Fix Cljs version of `disable-enforcement`
      
      * Misc improvements
      
      * Update tests
      
      * Fix Kondo warnings
      
      * Fix Kondo warnings
      
      * Fix busted Malli schema
      
      * PR feedback
      
      * Fix busted schema
      
      * Kondo fixx
      
      * Test fixes :wrench:
      
      * Use Malli version of `describe` now that PR was merged
      
      * Work around https://github.com/metosin/malli/issues/924
      
      * Test fixes :wrench:
      
      * Improvements
      
      * Test fix
      Unverified
      18c1b198
  5. Aug 03, 2023
  6. Aug 02, 2023
  7. Jul 31, 2023
  8. Jul 24, 2023
  9. Jul 14, 2023
  10. Jul 05, 2023
  11. Jul 04, 2023
  12. Jun 23, 2023
  13. Jun 21, 2023
  14. Jun 20, 2023
    • Noah Moss's avatar
      Connection impersonation (#30714) · f85ccd77
      Noah Moss authored
      * initial prototype w/out statement count parameter
      
      * new approach
      
      * default-database-role driver method
      
      * migration for connection_impersonations table
      
      * conn impersonation model, API and tests
      
      * impersonation fetch and deletion endpoints
      
      * switch test to t2 with-temp
      
      * read conn impersonation settings from DB
      
      * fix merge issue
      
      * add impersonated key to data perms graph and treat it the same as full self-service access
      
      * include impersonated key in returned permissions graph
      
      * make sure impersonated graph passes StrictDataPerms validation
      
      * fix boolean logic
      
      * make sure impersonated keyword doesnt cause error when deleting gtaps
      
      * clear impersonations as necessary when perms graphs changes
      
      * add impersonation support for postgres
      
      * fix typo
      
      * make sure impersonation updates are a non-lazy seq
      
      * add impersonated-user? fn
      
      * fix impersonation api tests
      
      * fix snippet tests
      
      * fix build & exclude connection impersonations from serialization
      
      * switch a test to use t2.with-temp
      
      * add with-impersonations helper and util tests
      
      * move macro and add a connection impersonation driver-level test for postgres
      
      * fix rebase issue
      
      * more tests and code reorganization
      
      * add snowflake test
      
      * clarify comment
      
      * fix lint errors
      
      * fix final kondo error
      
      * reorganization
      
      * fix one test
      
      * fix lint errors
      
      * revert change to sql_jdbc.execute from bad merge
      
      * make sure perms for all users gets reset after conn impersonation tests
      
      * ignore exceptions when restoring perms
      
      * fix postgres test
      
      * refactor to address bryan's comment
      
      * add note about new methods to database changelog
      
      * driver method refactor
      Unverified
      f85ccd77
    • john-metabase's avatar
  15. Jun 17, 2023
  16. Jun 16, 2023
  17. Jun 15, 2023
  18. Jun 08, 2023
  19. Jun 07, 2023
  20. Jun 02, 2023
  21. Jun 01, 2023
  22. May 26, 2023
    • lbrdnk's avatar
      Fix mongo nested queries handling (#30877) · 08a6a5c4
      lbrdnk authored
      * Fix native source query handling for mongo
      
      * Add test for mongo nested native query
      
      * Fix mongo `aggregation-at-index` usage
      
      * Add test for source query with aggregation and sort
      
      * Adjust test for presto and oracle
      
      * Add PR suggestions
      Unverified
      08a6a5c4
  23. May 24, 2023
  24. May 19, 2023
  25. May 18, 2023
  26. May 17, 2023
  27. May 16, 2023
    • dpsutton's avatar
      Lower threshold for redshift expiration to 1 hour (#30806) · 429eb678
      dpsutton authored
      Each test run can create schemas where we put persisted models. Normally
      these are thrown away when the test runner disconnects the db. But cloud
      is a persistent resource and they don't just fall away automatically.
      
      We create a cache_info table in each persisted schema:
      
      ```sql
      -- postgres/redshift
      test-data=# select * from metabase_cache_424a9_379.cache_info ;
             key        |                value
      ------------------+--------------------------------------
       settings-version | 1
       created-at       | 2023-03-29T14:16:24.849866Z
       instance-uuid    | 407e4ba8-2bab-470f-aeb5-9fc63fd18c4e
       instance-name    | Metabase Test
      (4 rows)
      ```
      
      And we delete these schemas in redshift when creating our test databases
      when their `created-at` is over 6 hours old.
      
      At the moment, there are (`(count (:all-schemas info))`) 420 schemas in
      redshift that we use on CI. 122 of those are cache schemas. Under a 6
      hour threshold, 121 are recent. Under a 1 hour threshold, 2 are recent.
      
      We've run out of tables in CI so I'm lowering the threshold for what
      "recent" is.
      Unverified
      429eb678
  28. May 15, 2023
  29. May 11, 2023
    • Cal Herries's avatar
      Add `schemas` driver feature (#30536) · 659db87c
      Cal Herries authored
      
      * Add schemas driver feature flag
      
      * Add sql_jdbc schemas test
      
      * Add more general test
      
      * Make schemas feature default to true
      
      * Implement supports? for other drivers
      
      * Add feature to the driver changelog
      
      * Remove redundant schemas from h2
      
      * Spelling fix
      
      Pre-rebase SHA: 8a2c7e0 or 5686b2f
      
      * MySQL does *not* support schemas
      
      * Bad rebase
      
      * Typo?
      
      Co-Authored-By: default avatarTim Macdonald <tim@metabase.com>
      Unverified
      659db87c
  30. May 05, 2023
    • Cal Herries's avatar
      Tidy driver/database-supports? defmethods and remove usage of driver/supports? (#29516) · ea25b693
      Cal Herries authored
      * Tidy database-supports? defmethods
      
      * Fix oracle build
      
      * Fix driver
      
      * Fix typo
      
      * prefer driver/database-supports? instead of driver/supports?
      
      * driver/supports? -> driver/database-supports? in tests
      
      * Fix foreign-key support for sqlite in tests
      
      * supports? -> database-supports?
      
      * `supports?` -> `database-supports?`
      
      * supports? -> database-supports?
      
      * Update supports? docstring
      
      * Fix tests
      
      * Fix test
      
      * Remove unused require
      
      * Add mt/with-everything-store in tests
      
      * fix test
      
      * Fix tests
      
      * Add note in driver changelog
      Unverified
      ea25b693
  31. May 03, 2023
  32. Apr 25, 2023
  33. Apr 24, 2023
Loading