u_items.sql 826 B

12345678910111213141516171819202122232425262728293031
  1. -- Copyright Materialize, Inc. and contributors. All rights reserved.
  2. --
  3. -- Use of this software is governed by the Business Source License
  4. -- included in the LICENSE file at the root of this repository.
  5. --
  6. -- As of the Change Date specified in that file, in accordance with
  7. -- the Business Source License, use of this software will be governed
  8. -- by the Apache License, Version 2.0.
  9. -- Get all user objects matching a given pattern.
  10. SELECT
  11. o.id as id,
  12. o.oid as oid,
  13. o.type as type,
  14. o.name as name,
  15. s.name as schema,
  16. d.name as database
  17. FROM
  18. mz_objects AS o JOIN
  19. mz_schemas AS s ON (o.schema_id = s.id) JOIN
  20. mz_databases AS d ON (s.database_id = d.id)
  21. WHERE
  22. o.id like 'u%' AND
  23. o.name ilike {name} AND
  24. s.name ilike {schema} AND
  25. d.name ilike {database}
  26. ORDER BY
  27. o.type,
  28. d.name,
  29. s.name,
  30. o.name;