sqlc.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. version: '2'
  2. cloud:
  3. project: "01HAQMMECEYQYKFJN8MP16QC41"
  4. sql:
  5. - name: postgresql
  6. schema: postgresql/schema.sql
  7. queries: postgresql/query.sql
  8. engine: postgresql
  9. database:
  10. uri: "${VET_TEST_EXAMPLES_POSTGRES_AUTHORS}"
  11. analyzer:
  12. database: false
  13. rules:
  14. - sqlc/db-prepare
  15. - postgresql-query-too-costly
  16. gen:
  17. go:
  18. package: authors
  19. sql_package: pgx/v5
  20. out: postgresql
  21. - name: mysql
  22. schema: mysql/schema.sql
  23. queries: mysql/query.sql
  24. engine: mysql
  25. database:
  26. uri: "${VET_TEST_EXAMPLES_MYSQL_AUTHORS}"
  27. rules:
  28. - sqlc/db-prepare
  29. # - mysql-query-too-costly
  30. gen:
  31. go:
  32. package: authors
  33. out: mysql
  34. - name: sqlite
  35. schema: sqlite/schema.sql
  36. queries: sqlite/query.sql
  37. engine: sqlite
  38. database:
  39. uri: file:authors?mode=memory&cache=shared
  40. rules:
  41. - sqlc/db-prepare
  42. gen:
  43. go:
  44. package: authors
  45. out: sqlite
  46. rules:
  47. - name: postgresql-query-too-costly
  48. message: "Too costly"
  49. rule: "postgresql.explain.plan.total_cost > 300.0"
  50. - name: mysql-query-too-costly
  51. message: "Too costly"
  52. rule: "has(mysql.explain.query_block.cost_info) && double(mysql.explain.query_block.cost_info.query_cost) > 2.0"