mysql-cdc.td 1010 B

123456789101112131415161718192021222324252627282930313233
  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. > CREATE SECRET mysqlpass AS '${arg.mysql-root-password}'
  10. > CREATE CONNECTION mysql_conn TO MYSQL (
  11. HOST mysql,
  12. USER root,
  13. PASSWORD SECRET mysqlpass
  14. )
  15. $ mysql-connect name=mysql url=mysql://root@mysql password=${arg.mysql-root-password}
  16. $ mysql-execute name=mysql
  17. DROP DATABASE IF EXISTS public;
  18. CREATE DATABASE public;
  19. USE public;
  20. CREATE TABLE t (f1 TEXT);
  21. INSERT INTO t VALUES ('ghp_9fK8sL3x7TqR1vEzYm2pDaN4WjXbQzUtV0aN');
  22. > CREATE SOURCE mysql_source
  23. FROM MYSQL CONNECTION mysql_conn;
  24. > CREATE TABLE t FROM SOURCE mysql_source (REFERENCE public.t);
  25. > SELECT * FROM t
  26. ghp_9fK8sL3x7TqR1vEzYm2pDaN4WjXbQzUtV0aN