├── .circleci └── config.yml ├── .gitattributes ├── .github └── dependabot.yml ├── .gitignore ├── .nvmrc ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── VERSION ├── admin.gif ├── api ├── client.go ├── design │ ├── api.go │ └── description.md ├── gen │ ├── health │ │ ├── client.go │ │ ├── endpoints.go │ │ └── service.go │ ├── http │ │ ├── cli │ │ │ └── api │ │ │ │ └── cli.go │ │ ├── health │ │ │ ├── client │ │ │ │ ├── cli.go │ │ │ │ ├── client.go │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ └── types.go │ │ │ └── server │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ ├── server.go │ │ │ │ └── types.go │ │ ├── imports │ │ │ ├── client │ │ │ │ ├── cli.go │ │ │ │ ├── client.go │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ └── types.go │ │ │ └── server │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ ├── server.go │ │ │ │ └── types.go │ │ ├── openapi.json │ │ ├── openapi.yaml │ │ ├── openapi3.json │ │ ├── openapi3.yaml │ │ ├── subscriptions │ │ │ ├── client │ │ │ │ ├── cli.go │ │ │ │ ├── client.go │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ └── types.go │ │ │ └── server │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ ├── server.go │ │ │ │ └── types.go │ │ ├── tables │ │ │ ├── client │ │ │ │ ├── cli.go │ │ │ │ ├── client.go │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ └── types.go │ │ │ └── server │ │ │ │ ├── encode_decode.go │ │ │ │ ├── paths.go │ │ │ │ ├── server.go │ │ │ │ └── types.go │ │ └── web │ │ │ ├── client │ │ │ ├── client.go │ │ │ ├── encode_decode.go │ │ │ ├── paths.go │ │ │ └── types.go │ │ │ └── server │ │ │ ├── paths.go │ │ │ ├── server.go │ │ │ └── types.go │ ├── imports │ │ ├── client.go │ │ ├── endpoints.go │ │ └── service.go │ ├── subscriptions │ │ ├── client.go │ │ ├── endpoints.go │ │ └── service.go │ ├── tables │ │ ├── client.go │ │ ├── endpoints.go │ │ └── service.go │ └── web │ │ ├── client.go │ │ ├── endpoints.go │ │ └── service.go ├── health.go ├── helpers.go ├── imports.go ├── subscriptions.go ├── suite_test.go ├── tables.go └── tables_test.go ├── cmd └── pgsink │ ├── cmd │ ├── app.go │ ├── http.go │ └── version.go │ └── main.go ├── docker-compose.yml ├── docker ├── gcloud-pubsub-emulator │ └── Dockerfile ├── grafana │ ├── dashboard-provisioner.yml │ ├── dashboards │ │ └── pg2sink.json │ └── datasource-provisioner.yml ├── postgres │ └── postgresql.conf └── prometheus │ ├── prometheus.yml │ └── rules.yml ├── go.mod ├── go.sum ├── goreleaser.yml ├── integration ├── file_test.go ├── integration_suite_test.go └── suite_test.go ├── internal ├── dbschema │ ├── information_schema │ │ ├── model │ │ │ ├── administrable_role_authorizations.go │ │ │ ├── applicable_roles.go │ │ │ ├── attributes.go │ │ │ ├── character_sets.go │ │ │ ├── check_constraint_routine_usage.go │ │ │ ├── check_constraints.go │ │ │ ├── collation_character_set_applicability.go │ │ │ ├── collations.go │ │ │ ├── column_column_usage.go │ │ │ ├── column_domain_usage.go │ │ │ ├── column_options.go │ │ │ ├── column_privileges.go │ │ │ ├── column_udt_usage.go │ │ │ ├── columns.go │ │ │ ├── constraint_column_usage.go │ │ │ ├── constraint_table_usage.go │ │ │ ├── data_type_privileges.go │ │ │ ├── domain_constraints.go │ │ │ ├── domain_udt_usage.go │ │ │ ├── domains.go │ │ │ ├── element_types.go │ │ │ ├── enabled_roles.go │ │ │ ├── foreign_data_wrapper_options.go │ │ │ ├── foreign_data_wrappers.go │ │ │ ├── foreign_server_options.go │ │ │ ├── foreign_servers.go │ │ │ ├── foreign_table_options.go │ │ │ ├── foreign_tables.go │ │ │ ├── information_schema_catalog_name.go │ │ │ ├── key_column_usage.go │ │ │ ├── parameters.go │ │ │ ├── referential_constraints.go │ │ │ ├── role_column_grants.go │ │ │ ├── role_routine_grants.go │ │ │ ├── role_table_grants.go │ │ │ ├── role_udt_grants.go │ │ │ ├── role_usage_grants.go │ │ │ ├── routine_privileges.go │ │ │ ├── routines.go │ │ │ ├── schemata.go │ │ │ ├── sequences.go │ │ │ ├── sql_features.go │ │ │ ├── sql_implementation_info.go │ │ │ ├── sql_sizing.go │ │ │ ├── table_constraints.go │ │ │ ├── table_privileges.go │ │ │ ├── tables.go │ │ │ ├── triggered_update_columns.go │ │ │ ├── triggers.go │ │ │ ├── udt_privileges.go │ │ │ ├── usage_privileges.go │ │ │ ├── user_defined_types.go │ │ │ ├── user_mapping_options.go │ │ │ ├── user_mappings.go │ │ │ ├── view_column_usage.go │ │ │ ├── view_routine_usage.go │ │ │ ├── view_table_usage.go │ │ │ └── views.go │ │ ├── table │ │ │ ├── sql_features.go │ │ │ ├── sql_implementation_info.go │ │ │ └── sql_sizing.go │ │ └── view │ │ │ ├── administrable_role_authorizations.go │ │ │ ├── applicable_roles.go │ │ │ ├── attributes.go │ │ │ ├── character_sets.go │ │ │ ├── check_constraint_routine_usage.go │ │ │ ├── check_constraints.go │ │ │ ├── collation_character_set_applicability.go │ │ │ ├── collations.go │ │ │ ├── column_column_usage.go │ │ │ ├── column_domain_usage.go │ │ │ ├── column_options.go │ │ │ ├── column_privileges.go │ │ │ ├── column_udt_usage.go │ │ │ ├── columns.go │ │ │ ├── constraint_column_usage.go │ │ │ ├── constraint_table_usage.go │ │ │ ├── data_type_privileges.go │ │ │ ├── domain_constraints.go │ │ │ ├── domain_udt_usage.go │ │ │ ├── domains.go │ │ │ ├── element_types.go │ │ │ ├── enabled_roles.go │ │ │ ├── foreign_data_wrapper_options.go │ │ │ ├── foreign_data_wrappers.go │ │ │ ├── foreign_server_options.go │ │ │ ├── foreign_servers.go │ │ │ ├── foreign_table_options.go │ │ │ ├── foreign_tables.go │ │ │ ├── information_schema_catalog_name.go │ │ │ ├── key_column_usage.go │ │ │ ├── parameters.go │ │ │ ├── referential_constraints.go │ │ │ ├── role_column_grants.go │ │ │ ├── role_routine_grants.go │ │ │ ├── role_table_grants.go │ │ │ ├── role_udt_grants.go │ │ │ ├── role_usage_grants.go │ │ │ ├── routine_privileges.go │ │ │ ├── routines.go │ │ │ ├── schemata.go │ │ │ ├── sequences.go │ │ │ ├── table_constraints.go │ │ │ ├── table_privileges.go │ │ │ ├── tables.go │ │ │ ├── triggered_update_columns.go │ │ │ ├── triggers.go │ │ │ ├── udt_privileges.go │ │ │ ├── usage_privileges.go │ │ │ ├── user_defined_types.go │ │ │ ├── user_mapping_options.go │ │ │ ├── user_mappings.go │ │ │ ├── view_column_usage.go │ │ │ ├── view_routine_usage.go │ │ │ ├── view_table_usage.go │ │ │ └── views.go │ ├── pg_catalog │ │ ├── model │ │ │ ├── pg_aggregate.go │ │ │ ├── pg_am.go │ │ │ ├── pg_amop.go │ │ │ ├── pg_amproc.go │ │ │ ├── pg_attrdef.go │ │ │ ├── pg_attribute.go │ │ │ ├── pg_auth_members.go │ │ │ ├── pg_available_extension_versions.go │ │ │ ├── pg_available_extensions.go │ │ │ ├── pg_cast.go │ │ │ ├── pg_class.go │ │ │ ├── pg_collation.go │ │ │ ├── pg_constraint.go │ │ │ ├── pg_conversion.go │ │ │ ├── pg_cursors.go │ │ │ ├── pg_database.go │ │ │ ├── pg_db_role_setting.go │ │ │ ├── pg_default_acl.go │ │ │ ├── pg_depend.go │ │ │ ├── pg_description.go │ │ │ ├── pg_enum.go │ │ │ ├── pg_event_trigger.go │ │ │ ├── pg_extension.go │ │ │ ├── pg_foreign_data_wrapper.go │ │ │ ├── pg_foreign_server.go │ │ │ ├── pg_foreign_table.go │ │ │ ├── pg_group.go │ │ │ ├── pg_index.go │ │ │ ├── pg_indexes.go │ │ │ ├── pg_inherits.go │ │ │ ├── pg_init_privs.go │ │ │ ├── pg_language.go │ │ │ ├── pg_largeobject_metadata.go │ │ │ ├── pg_locks.go │ │ │ ├── pg_matviews.go │ │ │ ├── pg_namespace.go │ │ │ ├── pg_opclass.go │ │ │ ├── pg_operator.go │ │ │ ├── pg_opfamily.go │ │ │ ├── pg_partitioned_table.go │ │ │ ├── pg_policies.go │ │ │ ├── pg_policy.go │ │ │ ├── pg_prepared_statements.go │ │ │ ├── pg_prepared_xacts.go │ │ │ ├── pg_proc.go │ │ │ ├── pg_publication.go │ │ │ ├── pg_publication_rel.go │ │ │ ├── pg_publication_tables.go │ │ │ ├── pg_range.go │ │ │ ├── pg_replication_origin.go │ │ │ ├── pg_replication_slots.go │ │ │ ├── pg_rewrite.go │ │ │ ├── pg_roles.go │ │ │ ├── pg_rules.go │ │ │ ├── pg_seclabel.go │ │ │ ├── pg_seclabels.go │ │ │ ├── pg_sequence.go │ │ │ ├── pg_sequences.go │ │ │ ├── pg_settings.go │ │ │ ├── pg_shdepend.go │ │ │ ├── pg_shdescription.go │ │ │ ├── pg_shseclabel.go │ │ │ ├── pg_stat_activity.go │ │ │ ├── pg_stat_all_indexes.go │ │ │ ├── pg_stat_all_tables.go │ │ │ ├── pg_stat_archiver.go │ │ │ ├── pg_stat_bgwriter.go │ │ │ ├── pg_stat_database.go │ │ │ ├── pg_stat_database_conflicts.go │ │ │ ├── pg_stat_gssapi.go │ │ │ ├── pg_stat_progress_analyze.go │ │ │ ├── pg_stat_progress_basebackup.go │ │ │ ├── pg_stat_progress_cluster.go │ │ │ ├── pg_stat_progress_create_index.go │ │ │ ├── pg_stat_progress_vacuum.go │ │ │ ├── pg_stat_replication.go │ │ │ ├── pg_stat_slru.go │ │ │ ├── pg_stat_ssl.go │ │ │ ├── pg_stat_subscription.go │ │ │ ├── pg_stat_sys_indexes.go │ │ │ ├── pg_stat_sys_tables.go │ │ │ ├── pg_stat_user_functions.go │ │ │ ├── pg_stat_user_indexes.go │ │ │ ├── pg_stat_user_tables.go │ │ │ ├── pg_stat_wal_receiver.go │ │ │ ├── pg_stat_xact_all_tables.go │ │ │ ├── pg_stat_xact_sys_tables.go │ │ │ ├── pg_stat_xact_user_functions.go │ │ │ ├── pg_stat_xact_user_tables.go │ │ │ ├── pg_statio_all_indexes.go │ │ │ ├── pg_statio_all_sequences.go │ │ │ ├── pg_statio_all_tables.go │ │ │ ├── pg_statio_sys_indexes.go │ │ │ ├── pg_statio_sys_sequences.go │ │ │ ├── pg_statio_sys_tables.go │ │ │ ├── pg_statio_user_indexes.go │ │ │ ├── pg_statio_user_sequences.go │ │ │ ├── pg_statio_user_tables.go │ │ │ ├── pg_statistic_ext.go │ │ │ ├── pg_stats.go │ │ │ ├── pg_stats_ext.go │ │ │ ├── pg_subscription.go │ │ │ ├── pg_subscription_rel.go │ │ │ ├── pg_tables.go │ │ │ ├── pg_tablespace.go │ │ │ ├── pg_timezone_abbrevs.go │ │ │ ├── pg_timezone_names.go │ │ │ ├── pg_transform.go │ │ │ ├── pg_trigger.go │ │ │ ├── pg_ts_config.go │ │ │ ├── pg_ts_config_map.go │ │ │ ├── pg_ts_dict.go │ │ │ ├── pg_ts_parser.go │ │ │ ├── pg_ts_template.go │ │ │ ├── pg_type.go │ │ │ ├── pg_user.go │ │ │ ├── pg_user_mappings.go │ │ │ └── pg_views.go │ │ ├── table │ │ │ ├── pg_aggregate.go │ │ │ ├── pg_am.go │ │ │ ├── pg_amop.go │ │ │ ├── pg_amproc.go │ │ │ ├── pg_attrdef.go │ │ │ ├── pg_attribute.go │ │ │ ├── pg_auth_members.go │ │ │ ├── pg_cast.go │ │ │ ├── pg_class.go │ │ │ ├── pg_collation.go │ │ │ ├── pg_constraint.go │ │ │ ├── pg_conversion.go │ │ │ ├── pg_database.go │ │ │ ├── pg_db_role_setting.go │ │ │ ├── pg_default_acl.go │ │ │ ├── pg_depend.go │ │ │ ├── pg_description.go │ │ │ ├── pg_enum.go │ │ │ ├── pg_event_trigger.go │ │ │ ├── pg_extension.go │ │ │ ├── pg_foreign_data_wrapper.go │ │ │ ├── pg_foreign_server.go │ │ │ ├── pg_foreign_table.go │ │ │ ├── pg_index.go │ │ │ ├── pg_inherits.go │ │ │ ├── pg_init_privs.go │ │ │ ├── pg_language.go │ │ │ ├── pg_largeobject_metadata.go │ │ │ ├── pg_namespace.go │ │ │ ├── pg_opclass.go │ │ │ ├── pg_operator.go │ │ │ ├── pg_opfamily.go │ │ │ ├── pg_partitioned_table.go │ │ │ ├── pg_policy.go │ │ │ ├── pg_proc.go │ │ │ ├── pg_publication.go │ │ │ ├── pg_publication_rel.go │ │ │ ├── pg_range.go │ │ │ ├── pg_replication_origin.go │ │ │ ├── pg_rewrite.go │ │ │ ├── pg_seclabel.go │ │ │ ├── pg_sequence.go │ │ │ ├── pg_shdepend.go │ │ │ ├── pg_shdescription.go │ │ │ ├── pg_shseclabel.go │ │ │ ├── pg_statistic_ext.go │ │ │ ├── pg_subscription.go │ │ │ ├── pg_subscription_rel.go │ │ │ ├── pg_tablespace.go │ │ │ ├── pg_transform.go │ │ │ ├── pg_trigger.go │ │ │ ├── pg_ts_config.go │ │ │ ├── pg_ts_config_map.go │ │ │ ├── pg_ts_dict.go │ │ │ ├── pg_ts_parser.go │ │ │ ├── pg_ts_template.go │ │ │ └── pg_type.go │ │ └── view │ │ │ ├── pg_available_extension_versions.go │ │ │ ├── pg_available_extensions.go │ │ │ ├── pg_cursors.go │ │ │ ├── pg_group.go │ │ │ ├── pg_indexes.go │ │ │ ├── pg_locks.go │ │ │ ├── pg_matviews.go │ │ │ ├── pg_policies.go │ │ │ ├── pg_prepared_statements.go │ │ │ ├── pg_prepared_xacts.go │ │ │ ├── pg_publication_tables.go │ │ │ ├── pg_replication_slots.go │ │ │ ├── pg_roles.go │ │ │ ├── pg_rules.go │ │ │ ├── pg_seclabels.go │ │ │ ├── pg_sequences.go │ │ │ ├── pg_settings.go │ │ │ ├── pg_stat_activity.go │ │ │ ├── pg_stat_all_indexes.go │ │ │ ├── pg_stat_all_tables.go │ │ │ ├── pg_stat_archiver.go │ │ │ ├── pg_stat_bgwriter.go │ │ │ ├── pg_stat_database.go │ │ │ ├── pg_stat_database_conflicts.go │ │ │ ├── pg_stat_gssapi.go │ │ │ ├── pg_stat_progress_analyze.go │ │ │ ├── pg_stat_progress_basebackup.go │ │ │ ├── pg_stat_progress_cluster.go │ │ │ ├── pg_stat_progress_create_index.go │ │ │ ├── pg_stat_progress_vacuum.go │ │ │ ├── pg_stat_replication.go │ │ │ ├── pg_stat_slru.go │ │ │ ├── pg_stat_ssl.go │ │ │ ├── pg_stat_subscription.go │ │ │ ├── pg_stat_sys_indexes.go │ │ │ ├── pg_stat_sys_tables.go │ │ │ ├── pg_stat_user_functions.go │ │ │ ├── pg_stat_user_indexes.go │ │ │ ├── pg_stat_user_tables.go │ │ │ ├── pg_stat_wal_receiver.go │ │ │ ├── pg_stat_xact_all_tables.go │ │ │ ├── pg_stat_xact_sys_tables.go │ │ │ ├── pg_stat_xact_user_functions.go │ │ │ ├── pg_stat_xact_user_tables.go │ │ │ ├── pg_statio_all_indexes.go │ │ │ ├── pg_statio_all_sequences.go │ │ │ ├── pg_statio_all_tables.go │ │ │ ├── pg_statio_sys_indexes.go │ │ │ ├── pg_statio_sys_sequences.go │ │ │ ├── pg_statio_sys_tables.go │ │ │ ├── pg_statio_user_indexes.go │ │ │ ├── pg_statio_user_sequences.go │ │ │ ├── pg_statio_user_tables.go │ │ │ ├── pg_stats.go │ │ │ ├── pg_stats_ext.go │ │ │ ├── pg_tables.go │ │ │ ├── pg_timezone_abbrevs.go │ │ │ ├── pg_timezone_names.go │ │ │ ├── pg_user.go │ │ │ ├── pg_user_mappings.go │ │ │ └── pg_views.go │ └── pgsink │ │ ├── model │ │ ├── import_jobs.go │ │ └── schema_migrations.go │ │ └── table │ │ ├── import_jobs.go │ │ └── schema_migrations.go ├── dbtest │ └── helpers.go ├── middleware │ └── middleware.go ├── migration │ ├── 20191229145951_create_import_jobs_table.go │ ├── 20200107164230_add_error_column_to_import_jobs_table.go │ ├── 20200112133745_add_subscription_name_to_import_jobs_table.go │ ├── 20200112145911_add_expired_at_to_import_jobs_table.go │ ├── 20200510142436_drop_import_jobs_table.go │ ├── 20200510142527_create_import_jobs_table.go │ ├── 20200525133118_add_error_column_to_import_jobs_table.go │ ├── 20210102200953_add_schema_column_to_import_jobs.go │ ├── 20210110203230_alter_table_import_jobs_add_error_count.go │ ├── 20210110210820_alter_table_import_jobs_add_last_error_at.go │ ├── 20210216150109_alter_table_import_jobs_add_progress.go │ ├── cmd │ │ └── goose.go │ └── migration.go └── telem │ └── telem.go ├── pkg ├── changelog │ ├── changelog.go │ ├── entry.go │ ├── matchers │ │ └── entry.go │ ├── modification.go │ ├── schema.go │ ├── serialize │ │ ├── json.go │ │ └── serialize.go │ ├── suite_test.go │ └── table.go ├── decode │ ├── cmd │ │ └── generate_mappings.go │ ├── decode.go │ ├── decode_test.go │ ├── gen │ │ └── mappings │ │ │ └── mappings.go │ └── suite_test.go ├── imports │ ├── import.go │ ├── import_test.go │ ├── importer.go │ ├── importer_test.go │ ├── manager.go │ ├── manager_test.go │ ├── suite_test.go │ ├── worker.go │ └── worker_test.go ├── logical │ ├── decoder.go │ └── message.go ├── sinks │ ├── bigquery │ │ ├── bigquery.go │ │ ├── decoder.go │ │ ├── decoder_test.go │ │ ├── schema_builders.go │ │ ├── schema_builders_test.go │ │ ├── schema_handler.go │ │ ├── sink.go │ │ ├── suite_test.go │ │ ├── table.go │ │ └── testdata │ │ │ ├── view.dogs.sql │ │ │ └── view.example.sql │ ├── file │ │ ├── file.go │ │ ├── inserter.go │ │ └── sink.go │ └── generic │ │ ├── README.md │ │ ├── async_inserter.go │ │ ├── async_inserter_suite_test.go │ │ ├── async_inserter_test.go │ │ ├── buffered_inserter.go │ │ ├── buffered_inserter_test.go │ │ ├── generic.go │ │ ├── helpers_test.go │ │ ├── insert_result.go │ │ ├── insert_result_test.go │ │ ├── inserter.go │ │ ├── inserter_test.go │ │ ├── instrumented_inserter.go │ │ ├── router.go │ │ ├── router_test.go │ │ ├── schema_handler.go │ │ ├── schema_handler_test.go │ │ ├── sink.go │ │ ├── suite_test.go │ │ └── testdata │ │ ├── schema.example.json │ │ └── schema.example_another.json └── subscription │ ├── changelog.go │ ├── manager.go │ ├── manager_test.go │ ├── marshal.go │ ├── publication.go │ ├── replication_slot.go │ ├── sequence.go │ ├── stream.go │ ├── subscription.go │ ├── subscription_test.go │ └── suite_test.go ├── structure.sql ├── tools.go └── web ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── README.md ├── build.go ├── build └── gitkeep ├── package.json ├── public ├── gitkeep ├── index.html ├── manifest.json └── robots.txt ├── src ├── api.ts ├── components │ ├── App.css │ ├── App.tsx │ ├── TableList.tsx │ ├── TableListRow.tsx │ ├── TableSearchBar.tsx │ ├── TableSyncToggle.tsx │ └── Tables.tsx ├── index.css ├── index.tsx ├── logo.svg ├── react-app-env.d.ts ├── reportWebVitals.ts └── setupTests.ts ├── tsconfig.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | api/gen linguist-generated 2 | clients/typescript linguist-generated 3 | internal/dbschema linguist-generated 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gomod 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | open-pull-requests-limit: 10 8 | ignore: 9 | - dependency-name: google.golang.org/api 10 | versions: 11 | - 0.38.0 12 | - 0.39.0 13 | - 0.40.0 14 | - 0.41.0 15 | - 0.42.0 16 | - 0.43.0 17 | - 0.44.0 18 | - dependency-name: go.opencensus.io 19 | versions: 20 | - 0.22.6 21 | - 0.23.0 22 | - dependency-name: contrib.go.opencensus.io/exporter/stackdriver 23 | versions: 24 | - 0.13.5 25 | - dependency-name: github.com/onsi/gomega 26 | versions: 27 | - 1.10.5 28 | - dependency-name: github.com/pressly/goose 29 | versions: 30 | - 2.7.0+incompatible 31 | - package-ecosystem: docker 32 | directory: "/" 33 | schedule: 34 | interval: daily 35 | open-pull-requests-limit: 10 36 | ignore: 37 | - dependency-name: golang 38 | versions: 39 | - 1.15.8 40 | - 1.16.0 41 | - 1.16.1 42 | - 1.16.2 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /dist/ 3 | /docs/ 4 | /tmp/ 5 | /vendor/ 6 | /openapi-generator-cli.jar 7 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 14.15.4 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # build 3 | ################################################################################ 4 | 5 | FROM golang:1.17.6 AS build 6 | COPY . /project 7 | WORKDIR /project 8 | 9 | # If we're running goreleaser, then our binary will already be copied into our 10 | # work directory, and we won't see the VERSION file. 11 | RUN set -x \ 12 | && \ 13 | if [ -f VERSION ]; then \ 14 | make default; \ 15 | else \ 16 | mkdir -p bin && mv -v * bin/; \ 17 | fi 18 | 19 | ################################################################################ 20 | # release 21 | ################################################################################ 22 | 23 | FROM ubuntu:bionic-20220105 AS release 24 | COPY --from=build /project/bin/* /usr/local/bin/ 25 | CMD ["/bin/bash"] 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Lawrence Jones 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.7.0 2 | -------------------------------------------------------------------------------- /admin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lawrencejones/pgsink/5d6fd5cdeda58969f116accba64ab6c7ea11b995/admin.gif -------------------------------------------------------------------------------- /api/design/description.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lawrencejones/pgsink/5d6fd5cdeda58969f116accba64ab6c7ea11b995/api/design/description.md -------------------------------------------------------------------------------- /api/gen/health/client.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health client 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package health 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Client is the "Health" service client. 17 | type Client struct { 18 | CheckEndpoint goa.Endpoint 19 | } 20 | 21 | // NewClient initializes a "Health" service client given the endpoints. 22 | func NewClient(check goa.Endpoint) *Client { 23 | return &Client{ 24 | CheckEndpoint: check, 25 | } 26 | } 27 | 28 | // Check calls the "Check" endpoint of the "Health" service. 29 | func (c *Client) Check(ctx context.Context) (res *CheckResult, err error) { 30 | var ires interface{} 31 | ires, err = c.CheckEndpoint(ctx, nil) 32 | if err != nil { 33 | return 34 | } 35 | return ires.(*CheckResult), nil 36 | } 37 | -------------------------------------------------------------------------------- /api/gen/health/endpoints.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health endpoints 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package health 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Endpoints wraps the "Health" service endpoints. 17 | type Endpoints struct { 18 | Check goa.Endpoint 19 | } 20 | 21 | // NewEndpoints wraps the methods of the "Health" service with endpoints. 22 | func NewEndpoints(s Service) *Endpoints { 23 | return &Endpoints{ 24 | Check: NewCheckEndpoint(s), 25 | } 26 | } 27 | 28 | // Use applies the given middleware to all the "Health" service endpoints. 29 | func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { 30 | e.Check = m(e.Check) 31 | } 32 | 33 | // NewCheckEndpoint returns an endpoint function that calls the method "Check" 34 | // of service "Health". 35 | func NewCheckEndpoint(s Service) goa.Endpoint { 36 | return func(ctx context.Context, req interface{}) (interface{}, error) { 37 | return s.Check(ctx) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/gen/health/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health service 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package health 9 | 10 | import ( 11 | "context" 12 | ) 13 | 14 | // Provide service health information 15 | type Service interface { 16 | // Health check for probes 17 | Check(context.Context) (res *CheckResult, err error) 18 | } 19 | 20 | // ServiceName is the name of the service as defined in the design. This is the 21 | // same value that is set in the endpoint request contexts under the ServiceKey 22 | // key. 23 | const ServiceName = "Health" 24 | 25 | // MethodNames lists the service method names as defined in the design. These 26 | // are the same values that are set in the endpoint request contexts under the 27 | // MethodKey key. 28 | var MethodNames = [1]string{"Check"} 29 | 30 | // CheckResult is the result type of the Health service Check method. 31 | type CheckResult struct { 32 | // Status of the API 33 | Status string 34 | } 35 | -------------------------------------------------------------------------------- /api/gen/http/health/client/cli.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health HTTP client CLI support package 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | -------------------------------------------------------------------------------- /api/gen/http/health/client/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Health service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | // CheckHealthPath returns the URL path to the Health service Check HTTP endpoint. 11 | func CheckHealthPath() string { 12 | return "/api/health/check" 13 | } 14 | -------------------------------------------------------------------------------- /api/gen/http/health/client/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health HTTP client types 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | import ( 11 | health "github.com/lawrencejones/pgsink/api/gen/health" 12 | goa "goa.design/goa/v3/pkg" 13 | ) 14 | 15 | // CheckResponseBody is the type of the "Health" service "Check" endpoint HTTP 16 | // response body. 17 | type CheckResponseBody struct { 18 | // Status of the API 19 | Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"` 20 | } 21 | 22 | // NewCheckResultOK builds a "Health" service "Check" endpoint result from a 23 | // HTTP "OK" response. 24 | func NewCheckResultOK(body *CheckResponseBody) *health.CheckResult { 25 | v := &health.CheckResult{ 26 | Status: *body.Status, 27 | } 28 | 29 | return v 30 | } 31 | 32 | // ValidateCheckResponseBody runs the validations defined on CheckResponseBody 33 | func ValidateCheckResponseBody(body *CheckResponseBody) (err error) { 34 | if body.Status == nil { 35 | err = goa.MergeErrors(err, goa.MissingFieldError("status", "body")) 36 | } 37 | if body.Status != nil { 38 | if !(*body.Status == "healthy") { 39 | err = goa.MergeErrors(err, goa.InvalidEnumValueError("body.status", *body.Status, []interface{}{"healthy"})) 40 | } 41 | } 42 | return 43 | } 44 | -------------------------------------------------------------------------------- /api/gen/http/health/server/encode_decode.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health HTTP server encoders and decoders 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | import ( 11 | "context" 12 | "net/http" 13 | 14 | health "github.com/lawrencejones/pgsink/api/gen/health" 15 | goahttp "goa.design/goa/v3/http" 16 | ) 17 | 18 | // EncodeCheckResponse returns an encoder for responses returned by the Health 19 | // Check endpoint. 20 | func EncodeCheckResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { 21 | return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { 22 | res, _ := v.(*health.CheckResult) 23 | enc := encoder(ctx, w) 24 | body := NewCheckResponseBody(res) 25 | w.WriteHeader(http.StatusOK) 26 | return enc.Encode(body) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/gen/http/health/server/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Health service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | // CheckHealthPath returns the URL path to the Health service Check HTTP endpoint. 11 | func CheckHealthPath() string { 12 | return "/api/health/check" 13 | } 14 | -------------------------------------------------------------------------------- /api/gen/http/health/server/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Health HTTP server types 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | import ( 11 | health "github.com/lawrencejones/pgsink/api/gen/health" 12 | ) 13 | 14 | // CheckResponseBody is the type of the "Health" service "Check" endpoint HTTP 15 | // response body. 16 | type CheckResponseBody struct { 17 | // Status of the API 18 | Status string `form:"status" json:"status" xml:"status"` 19 | } 20 | 21 | // NewCheckResponseBody builds the HTTP response body from the result of the 22 | // "Check" endpoint of the "Health" service. 23 | func NewCheckResponseBody(res *health.CheckResult) *CheckResponseBody { 24 | body := &CheckResponseBody{ 25 | Status: res.Status, 26 | } 27 | return body 28 | } 29 | -------------------------------------------------------------------------------- /api/gen/http/imports/client/cli.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Imports HTTP client CLI support package 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | -------------------------------------------------------------------------------- /api/gen/http/imports/client/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Imports service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | // ListImportsPath returns the URL path to the Imports service List HTTP endpoint. 11 | func ListImportsPath() string { 12 | return "/api/imports" 13 | } 14 | -------------------------------------------------------------------------------- /api/gen/http/imports/server/encode_decode.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Imports HTTP server encoders and decoders 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | import ( 11 | "context" 12 | "net/http" 13 | 14 | imports "github.com/lawrencejones/pgsink/api/gen/imports" 15 | goahttp "goa.design/goa/v3/http" 16 | ) 17 | 18 | // EncodeListResponse returns an encoder for responses returned by the Imports 19 | // List endpoint. 20 | func EncodeListResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { 21 | return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { 22 | res, _ := v.([]*imports.Import) 23 | enc := encoder(ctx, w) 24 | body := NewListResponseBody(res) 25 | w.WriteHeader(http.StatusOK) 26 | return enc.Encode(body) 27 | } 28 | } 29 | 30 | // marshalImportsImportToImportResponse builds a value of type *ImportResponse 31 | // from a value of type *imports.Import. 32 | func marshalImportsImportToImportResponse(v *imports.Import) *ImportResponse { 33 | res := &ImportResponse{ 34 | ID: v.ID, 35 | SubscriptionID: v.SubscriptionID, 36 | Schema: v.Schema, 37 | TableName: v.TableName, 38 | CompletedAt: v.CompletedAt, 39 | CreatedAt: v.CreatedAt, 40 | UpdatedAt: v.UpdatedAt, 41 | ExpiredAt: v.ExpiredAt, 42 | Error: v.Error, 43 | ErrorCount: v.ErrorCount, 44 | LastErrorAt: v.LastErrorAt, 45 | RowsProcessedTotal: v.RowsProcessedTotal, 46 | } 47 | 48 | return res 49 | } 50 | -------------------------------------------------------------------------------- /api/gen/http/imports/server/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Imports service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | // ListImportsPath returns the URL path to the Imports service List HTTP endpoint. 11 | func ListImportsPath() string { 12 | return "/api/imports" 13 | } 14 | -------------------------------------------------------------------------------- /api/gen/http/subscriptions/client/cli.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Subscriptions HTTP client CLI support package 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | import ( 11 | "encoding/json" 12 | "fmt" 13 | 14 | subscriptions "github.com/lawrencejones/pgsink/api/gen/subscriptions" 15 | ) 16 | 17 | // BuildAddTablePayload builds the payload for the Subscriptions AddTable 18 | // endpoint from CLI flags. 19 | func BuildAddTablePayload(subscriptionsAddTableBody string) (*subscriptions.SubscriptionPublishedTable, error) { 20 | var err error 21 | var body AddTableRequestBody 22 | { 23 | err = json.Unmarshal([]byte(subscriptionsAddTableBody), &body) 24 | if err != nil { 25 | return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"name\": \"payments\",\n \"schema\": \"public\"\n }'") 26 | } 27 | } 28 | v := &subscriptions.SubscriptionPublishedTable{ 29 | Schema: body.Schema, 30 | Name: body.Name, 31 | } 32 | 33 | return v, nil 34 | } 35 | 36 | // BuildStopTablePayload builds the payload for the Subscriptions StopTable 37 | // endpoint from CLI flags. 38 | func BuildStopTablePayload(subscriptionsStopTableBody string) (*subscriptions.SubscriptionPublishedTable, error) { 39 | var err error 40 | var body StopTableRequestBody 41 | { 42 | err = json.Unmarshal([]byte(subscriptionsStopTableBody), &body) 43 | if err != nil { 44 | return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"name\": \"payments\",\n \"schema\": \"public\"\n }'") 45 | } 46 | } 47 | v := &subscriptions.SubscriptionPublishedTable{ 48 | Schema: body.Schema, 49 | Name: body.Name, 50 | } 51 | 52 | return v, nil 53 | } 54 | -------------------------------------------------------------------------------- /api/gen/http/subscriptions/client/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Subscriptions service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | // GetSubscriptionsPath returns the URL path to the Subscriptions service Get HTTP endpoint. 11 | func GetSubscriptionsPath() string { 12 | return "/api/subscriptions/current" 13 | } 14 | 15 | // AddTableSubscriptionsPath returns the URL path to the Subscriptions service AddTable HTTP endpoint. 16 | func AddTableSubscriptionsPath() string { 17 | return "/api/subscriptions/current/actions/add-table" 18 | } 19 | 20 | // StopTableSubscriptionsPath returns the URL path to the Subscriptions service StopTable HTTP endpoint. 21 | func StopTableSubscriptionsPath() string { 22 | return "/api/subscriptions/current/actions/stop-table" 23 | } 24 | -------------------------------------------------------------------------------- /api/gen/http/subscriptions/server/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Subscriptions service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | // GetSubscriptionsPath returns the URL path to the Subscriptions service Get HTTP endpoint. 11 | func GetSubscriptionsPath() string { 12 | return "/api/subscriptions/current" 13 | } 14 | 15 | // AddTableSubscriptionsPath returns the URL path to the Subscriptions service AddTable HTTP endpoint. 16 | func AddTableSubscriptionsPath() string { 17 | return "/api/subscriptions/current/actions/add-table" 18 | } 19 | 20 | // StopTableSubscriptionsPath returns the URL path to the Subscriptions service StopTable HTTP endpoint. 21 | func StopTableSubscriptionsPath() string { 22 | return "/api/subscriptions/current/actions/stop-table" 23 | } 24 | -------------------------------------------------------------------------------- /api/gen/http/tables/client/cli.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Tables HTTP client CLI support package 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | import ( 11 | tables "github.com/lawrencejones/pgsink/api/gen/tables" 12 | ) 13 | 14 | // BuildListPayload builds the payload for the Tables List endpoint from CLI 15 | // flags. 16 | func BuildListPayload(tablesListSchema string) (*tables.ListPayload, error) { 17 | var schema string 18 | { 19 | if tablesListSchema != "" { 20 | schema = tablesListSchema 21 | } 22 | } 23 | v := &tables.ListPayload{} 24 | v.Schema = schema 25 | 26 | return v, nil 27 | } 28 | -------------------------------------------------------------------------------- /api/gen/http/tables/client/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Tables service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | // ListTablesPath returns the URL path to the Tables service List HTTP endpoint. 11 | func ListTablesPath() string { 12 | return "/api/tables" 13 | } 14 | -------------------------------------------------------------------------------- /api/gen/http/tables/server/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Tables service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | 10 | // ListTablesPath returns the URL path to the Tables service List HTTP endpoint. 11 | func ListTablesPath() string { 12 | return "/api/tables" 13 | } 14 | -------------------------------------------------------------------------------- /api/gen/http/web/client/client.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web client HTTP transport 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | 10 | import ( 11 | "net/http" 12 | 13 | goahttp "goa.design/goa/v3/http" 14 | ) 15 | 16 | // Client lists the Web service endpoint HTTP clients. 17 | type Client struct { 18 | // RestoreResponseBody controls whether the response bodies are reset after 19 | // decoding so they can be read again. 20 | RestoreResponseBody bool 21 | 22 | scheme string 23 | host string 24 | encoder func(*http.Request) goahttp.Encoder 25 | decoder func(*http.Response) goahttp.Decoder 26 | } 27 | 28 | // NewClient instantiates HTTP clients for all the Web service servers. 29 | func NewClient( 30 | scheme string, 31 | host string, 32 | doer goahttp.Doer, 33 | enc func(*http.Request) goahttp.Encoder, 34 | dec func(*http.Response) goahttp.Decoder, 35 | restoreBody bool, 36 | ) *Client { 37 | return &Client{ 38 | RestoreResponseBody: restoreBody, 39 | scheme: scheme, 40 | host: host, 41 | decoder: dec, 42 | encoder: enc, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/gen/http/web/client/encode_decode.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web HTTP client encoders and decoders 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | -------------------------------------------------------------------------------- /api/gen/http/web/client/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Web service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | -------------------------------------------------------------------------------- /api/gen/http/web/client/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web HTTP client types 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package client 9 | -------------------------------------------------------------------------------- /api/gen/http/web/server/paths.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // HTTP request path constructors for the Web service. 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | -------------------------------------------------------------------------------- /api/gen/http/web/server/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web HTTP server types 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package server 9 | -------------------------------------------------------------------------------- /api/gen/imports/client.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Imports client 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package imports 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Client is the "Imports" service client. 17 | type Client struct { 18 | ListEndpoint goa.Endpoint 19 | } 20 | 21 | // NewClient initializes a "Imports" service client given the endpoints. 22 | func NewClient(list goa.Endpoint) *Client { 23 | return &Client{ 24 | ListEndpoint: list, 25 | } 26 | } 27 | 28 | // List calls the "List" endpoint of the "Imports" service. 29 | func (c *Client) List(ctx context.Context) (res []*Import, err error) { 30 | var ires interface{} 31 | ires, err = c.ListEndpoint(ctx, nil) 32 | if err != nil { 33 | return 34 | } 35 | return ires.([]*Import), nil 36 | } 37 | -------------------------------------------------------------------------------- /api/gen/imports/endpoints.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Imports endpoints 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package imports 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Endpoints wraps the "Imports" service endpoints. 17 | type Endpoints struct { 18 | List goa.Endpoint 19 | } 20 | 21 | // NewEndpoints wraps the methods of the "Imports" service with endpoints. 22 | func NewEndpoints(s Service) *Endpoints { 23 | return &Endpoints{ 24 | List: NewListEndpoint(s), 25 | } 26 | } 27 | 28 | // Use applies the given middleware to all the "Imports" service endpoints. 29 | func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { 30 | e.List = m(e.List) 31 | } 32 | 33 | // NewListEndpoint returns an endpoint function that calls the method "List" of 34 | // service "Imports". 35 | func NewListEndpoint(s Service) goa.Endpoint { 36 | return func(ctx context.Context, req interface{}) (interface{}, error) { 37 | return s.List(ctx) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/gen/imports/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Imports service 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package imports 9 | 10 | import ( 11 | "context" 12 | ) 13 | 14 | // Manage table imports, scoped to the server subscription ID 15 | type Service interface { 16 | // List all imports 17 | List(context.Context) (res []*Import, err error) 18 | } 19 | 20 | // ServiceName is the name of the service as defined in the design. This is the 21 | // same value that is set in the endpoint request contexts under the ServiceKey 22 | // key. 23 | const ServiceName = "Imports" 24 | 25 | // MethodNames lists the service method names as defined in the design. These 26 | // are the same values that are set in the endpoint request contexts under the 27 | // MethodKey key. 28 | var MethodNames = [1]string{"List"} 29 | 30 | // Import job for a Postgres table 31 | type Import struct { 32 | // Unique ID for the import 33 | ID int 34 | // Subscription ID, associating this import to a specific subscription 35 | SubscriptionID string 36 | // Postgres table schema 37 | Schema string 38 | // Postgres table name 39 | TableName string 40 | // Import was completed at this time 41 | CompletedAt *string 42 | // Import was created at this time 43 | CreatedAt string 44 | // Import was last updated at this time 45 | UpdatedAt string 46 | // Import was expired at this time 47 | ExpiredAt *string 48 | // Last import error 49 | Error *string 50 | // Count of error attempts 51 | ErrorCount int 52 | // Timestamp of last error, only reset on error 53 | LastErrorAt *string 54 | // Count of rows processed 55 | RowsProcessedTotal int64 56 | } 57 | -------------------------------------------------------------------------------- /api/gen/subscriptions/client.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Subscriptions client 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package subscriptions 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Client is the "Subscriptions" service client. 17 | type Client struct { 18 | GetEndpoint goa.Endpoint 19 | AddTableEndpoint goa.Endpoint 20 | StopTableEndpoint goa.Endpoint 21 | } 22 | 23 | // NewClient initializes a "Subscriptions" service client given the endpoints. 24 | func NewClient(get, addTable, stopTable goa.Endpoint) *Client { 25 | return &Client{ 26 | GetEndpoint: get, 27 | AddTableEndpoint: addTable, 28 | StopTableEndpoint: stopTable, 29 | } 30 | } 31 | 32 | // Get calls the "Get" endpoint of the "Subscriptions" service. 33 | func (c *Client) Get(ctx context.Context) (res *Subscription, err error) { 34 | var ires interface{} 35 | ires, err = c.GetEndpoint(ctx, nil) 36 | if err != nil { 37 | return 38 | } 39 | return ires.(*Subscription), nil 40 | } 41 | 42 | // AddTable calls the "AddTable" endpoint of the "Subscriptions" service. 43 | func (c *Client) AddTable(ctx context.Context, p *SubscriptionPublishedTable) (res *Subscription, err error) { 44 | var ires interface{} 45 | ires, err = c.AddTableEndpoint(ctx, p) 46 | if err != nil { 47 | return 48 | } 49 | return ires.(*Subscription), nil 50 | } 51 | 52 | // StopTable calls the "StopTable" endpoint of the "Subscriptions" service. 53 | func (c *Client) StopTable(ctx context.Context, p *SubscriptionPublishedTable) (res *Subscription, err error) { 54 | var ires interface{} 55 | ires, err = c.StopTableEndpoint(ctx, p) 56 | if err != nil { 57 | return 58 | } 59 | return ires.(*Subscription), nil 60 | } 61 | -------------------------------------------------------------------------------- /api/gen/subscriptions/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Subscriptions service 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package subscriptions 9 | 10 | import ( 11 | "context" 12 | ) 13 | 14 | // Manage a pgsink subscription 15 | type Service interface { 16 | // Get current subscription data 17 | Get(context.Context) (res *Subscription, err error) 18 | // Add table to publication, relying on an import manager to schedule the job 19 | AddTable(context.Context, *SubscriptionPublishedTable) (res *Subscription, err error) 20 | // Stop a table by removing it from the publication, and expiring any import 21 | // jobs 22 | StopTable(context.Context, *SubscriptionPublishedTable) (res *Subscription, err error) 23 | } 24 | 25 | // ServiceName is the name of the service as defined in the design. This is the 26 | // same value that is set in the endpoint request contexts under the ServiceKey 27 | // key. 28 | const ServiceName = "Subscriptions" 29 | 30 | // MethodNames lists the service method names as defined in the design. These 31 | // are the same values that are set in the endpoint request contexts under the 32 | // MethodKey key. 33 | var MethodNames = [3]string{"Get", "AddTable", "StopTable"} 34 | 35 | // Subscription is the result type of the Subscriptions service Get method. 36 | type Subscription struct { 37 | // ID of subscription 38 | ID string 39 | // List of published tables 40 | PublishedTables []*SubscriptionPublishedTable 41 | } 42 | 43 | // SubscriptionPublishedTable is the payload type of the Subscriptions service 44 | // AddTable method. 45 | type SubscriptionPublishedTable struct { 46 | // Postgres table schema 47 | Schema string 48 | // Postgres table name 49 | Name string 50 | } 51 | -------------------------------------------------------------------------------- /api/gen/tables/client.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Tables client 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package tables 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Client is the "Tables" service client. 17 | type Client struct { 18 | ListEndpoint goa.Endpoint 19 | } 20 | 21 | // NewClient initializes a "Tables" service client given the endpoints. 22 | func NewClient(list goa.Endpoint) *Client { 23 | return &Client{ 24 | ListEndpoint: list, 25 | } 26 | } 27 | 28 | // List calls the "List" endpoint of the "Tables" service. 29 | func (c *Client) List(ctx context.Context, p *ListPayload) (res []*Table, err error) { 30 | var ires interface{} 31 | ires, err = c.ListEndpoint(ctx, p) 32 | if err != nil { 33 | return 34 | } 35 | return ires.([]*Table), nil 36 | } 37 | -------------------------------------------------------------------------------- /api/gen/tables/endpoints.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Tables endpoints 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package tables 9 | 10 | import ( 11 | "context" 12 | 13 | goa "goa.design/goa/v3/pkg" 14 | ) 15 | 16 | // Endpoints wraps the "Tables" service endpoints. 17 | type Endpoints struct { 18 | List goa.Endpoint 19 | } 20 | 21 | // NewEndpoints wraps the methods of the "Tables" service with endpoints. 22 | func NewEndpoints(s Service) *Endpoints { 23 | return &Endpoints{ 24 | List: NewListEndpoint(s), 25 | } 26 | } 27 | 28 | // Use applies the given middleware to all the "Tables" service endpoints. 29 | func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { 30 | e.List = m(e.List) 31 | } 32 | 33 | // NewListEndpoint returns an endpoint function that calls the method "List" of 34 | // service "Tables". 35 | func NewListEndpoint(s Service) goa.Endpoint { 36 | return func(ctx context.Context, req interface{}) (interface{}, error) { 37 | p := req.(*ListPayload) 38 | return s.List(ctx, p) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /api/gen/tables/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Tables service 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package tables 9 | 10 | import ( 11 | "context" 12 | ) 13 | 14 | // Expose Postgres tables, and their import/sync status 15 | type Service interface { 16 | // List all tables 17 | List(context.Context, *ListPayload) (res []*Table, err error) 18 | } 19 | 20 | // ServiceName is the name of the service as defined in the design. This is the 21 | // same value that is set in the endpoint request contexts under the ServiceKey 22 | // key. 23 | const ServiceName = "Tables" 24 | 25 | // MethodNames lists the service method names as defined in the design. These 26 | // are the same values that are set in the endpoint request contexts under the 27 | // MethodKey key. 28 | var MethodNames = [1]string{"List"} 29 | 30 | // ListPayload is the payload type of the Tables service List method. 31 | type ListPayload struct { 32 | // Comma separated list of Postgres schemas to filter by 33 | Schema string 34 | } 35 | 36 | // Postgres table, with sync and import status 37 | type Table struct { 38 | // Postgres table schema 39 | Schema string 40 | // Postgres table name 41 | Name string 42 | // Table row estimate, using pg_stats 43 | ApproximateRowCount int64 44 | // Status of the publication, set to active when table is streaming 45 | PublicationStatus string 46 | // Status of table imports 47 | ImportStatus string 48 | // Last active import rows processed total 49 | ImportRowsProcessedTotal int64 50 | } 51 | -------------------------------------------------------------------------------- /api/gen/web/client.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web client 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package web 9 | 10 | import ( 11 | goa "goa.design/goa/v3/pkg" 12 | ) 13 | 14 | // Client is the "Web" service client. 15 | type Client struct { 16 | } 17 | 18 | // NewClient initializes a "Web" service client given the endpoints. 19 | func NewClient(goa.Endpoint) *Client { 20 | return &Client{} 21 | } 22 | -------------------------------------------------------------------------------- /api/gen/web/endpoints.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web endpoints 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package web 9 | 10 | import ( 11 | goa "goa.design/goa/v3/pkg" 12 | ) 13 | 14 | // Endpoints wraps the "Web" service endpoints. 15 | type Endpoints struct { 16 | } 17 | 18 | // NewEndpoints wraps the methods of the "Web" service with endpoints. 19 | func NewEndpoints(s Service) *Endpoints { 20 | return &Endpoints{} 21 | } 22 | 23 | // Use applies the given middleware to all the "Web" service endpoints. 24 | func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { 25 | } 26 | -------------------------------------------------------------------------------- /api/gen/web/service.go: -------------------------------------------------------------------------------- 1 | // Code generated by goa v3.5.4, DO NOT EDIT. 2 | // 3 | // Web service 4 | // 5 | // Command: 6 | // $ goa gen github.com/lawrencejones/pgsink/api/design -o api 7 | 8 | package web 9 | 10 | // Web static web content for the UI 11 | type Service interface { 12 | } 13 | 14 | // ServiceName is the name of the service as defined in the design. This is the 15 | // same value that is set in the endpoint request contexts under the ServiceKey 16 | // key. 17 | const ServiceName = "Web" 18 | 19 | // MethodNames lists the service method names as defined in the design. These 20 | // are the same values that are set in the endpoint request contexts under the 21 | // MethodKey key. 22 | var MethodNames = [0]string{} 23 | -------------------------------------------------------------------------------- /api/health.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/lawrencejones/pgsink/api/gen/health" 7 | ) 8 | 9 | type healthService struct { 10 | } 11 | 12 | func NewHealth() health.Service { 13 | return &healthService{} 14 | } 15 | 16 | func (h *healthService) Check(ctx context.Context) (res *health.CheckResult, err error) { 17 | return &health.CheckResult{Status: "healthy"}, nil 18 | } 19 | -------------------------------------------------------------------------------- /api/helpers.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import "time" 4 | 5 | // FormatDateTime generates an RFC3339 string of the given timestamp, or an empty string 6 | // if the time is zero. 7 | func FormatDateTime(ts time.Time) string { 8 | if ts.IsZero() { 9 | return "" 10 | } 11 | 12 | return ts.Format(time.RFC3339) 13 | } 14 | 15 | // FormatDateTimePointer generates an RFC3339 string of the given timestamp, or nil if it 16 | // was empty/nil. 17 | func FormatDateTimePointer(ts *time.Time) *string { 18 | if ts == nil { 19 | return nil 20 | } 21 | 22 | result := FormatDateTime(*ts) 23 | if result == "" { 24 | return nil 25 | } 26 | 27 | return &result 28 | } 29 | -------------------------------------------------------------------------------- /api/imports.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | 7 | pg "github.com/go-jet/jet/v2/postgres" 8 | apiimports "github.com/lawrencejones/pgsink/api/gen/imports" 9 | "github.com/lawrencejones/pgsink/internal/dbschema/pgsink/model" 10 | . "github.com/lawrencejones/pgsink/internal/dbschema/pgsink/table" 11 | "github.com/lawrencejones/pgsink/pkg/subscription" 12 | ) 13 | 14 | type importsService struct { 15 | db *sql.DB 16 | pub *subscription.Publication 17 | } 18 | 19 | func NewImports(db *sql.DB, pub *subscription.Publication) apiimports.Service { 20 | return &importsService{db, pub} 21 | } 22 | 23 | func (s *importsService) List(ctx context.Context) (imports []*apiimports.Import, err error) { 24 | stmt := ImportJobs. 25 | SELECT(ImportJobs.AllColumns). 26 | WHERE( 27 | ImportJobs.SubscriptionID.EQ(pg.String(s.pub.ID)), 28 | ) 29 | 30 | var rows []model.ImportJobs 31 | if err := stmt.QueryContext(ctx, s.db, &rows); err != nil { 32 | return nil, err 33 | } 34 | 35 | for _, row := range rows { 36 | imports = append(imports, s.serialize(row)) 37 | } 38 | 39 | return imports, nil 40 | } 41 | 42 | func (s *importsService) serialize(job model.ImportJobs) *apiimports.Import { 43 | return &apiimports.Import{ 44 | ID: int(job.ID), 45 | SubscriptionID: job.SubscriptionID, 46 | Schema: job.Schema, 47 | TableName: job.TableName, 48 | CompletedAt: FormatDateTimePointer(job.CompletedAt), 49 | CreatedAt: FormatDateTime(job.CreatedAt), 50 | UpdatedAt: FormatDateTime(job.UpdatedAt), 51 | ExpiredAt: FormatDateTimePointer(job.ExpiredAt), 52 | Error: job.Error, 53 | ErrorCount: int(job.ErrorCount), 54 | LastErrorAt: FormatDateTimePointer(job.LastErrorAt), 55 | RowsProcessedTotal: job.RowsProcessedTotal, 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /api/suite_test.go: -------------------------------------------------------------------------------- 1 | package api_test 2 | 3 | import ( 4 | "testing" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | ) 11 | 12 | var logger = kitlog.NewLogfmtLogger(GinkgoWriter) 13 | 14 | func TestSuite(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "api") 17 | } 18 | -------------------------------------------------------------------------------- /cmd/pgsink/cmd/version.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | ) 7 | 8 | // Set by goreleaser 9 | var ( 10 | Version = "dev" 11 | Commit = "none" 12 | Date = "unknown" 13 | GoVersion = runtime.Version() 14 | ) 15 | 16 | func versionStanza() string { 17 | return fmt.Sprintf( 18 | "pgsink Version: %v\nGit SHA: %v\nGo Version: %v\nGo OS/Arch: %v/%v\nBuilt at: %v", 19 | Version, Commit, GoVersion, runtime.GOOS, runtime.GOARCH, Date, 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /cmd/pgsink/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/alecthomas/kingpin" 5 | "github.com/lawrencejones/pgsink/cmd/pgsink/cmd" 6 | ) 7 | 8 | func main() { 9 | if err := cmd.Run(); err != nil { 10 | kingpin.Fatalf(err.Error()) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docker/gcloud-pubsub-emulator/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM google/cloud-sdk:274.0.1 2 | RUN set -x \ 3 | && apt-get install -y default-jre \ 4 | && apt-get install google-cloud-sdk-pubsub-emulator google-cloud-sdk 5 | 6 | ENV DATA_DIR=/data 7 | ENV HOST_PORT=0.0.0.0:8080 8 | EXPOSE 8080 9 | 10 | CMD ["sh", "-c", "exec gcloud beta emulators pubsub start --project=pgsink --host-port=${HOST_PORT} --data-dir=${DATA_DIR}"] 11 | -------------------------------------------------------------------------------- /docker/grafana/dashboard-provisioner.yml: -------------------------------------------------------------------------------- 1 | # Load dashboards from /var/lib/grafana/dashboards 2 | --- 3 | apiVersion: 1 4 | 5 | providers: 6 | - name: 'default' 7 | orgId: 1 8 | folder: '' 9 | type: file 10 | disableDeletion: true 11 | updateIntervalSeconds: 10 12 | options: 13 | path: /var/lib/grafana/dashboards 14 | -------------------------------------------------------------------------------- /docker/grafana/datasource-provisioner.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1 3 | 4 | datasources: 5 | - name: Prometheus 6 | type: prometheus 7 | default: true 8 | url: http://prometheus:9090 9 | access: proxy 10 | - name: Jaeger 11 | type: jaeger 12 | url: http://jaeger:16686 13 | access: proxy 14 | -------------------------------------------------------------------------------- /docker/postgres/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' 2 | max_connections = 100 # (change requires restart) 3 | shared_buffers = 128MB # min 128kB 4 | dynamic_shared_memory_type = posix # the default is the first option 5 | wal_level = logical # minimal, replica, or logical 6 | full_page_writes = on # recover from partial page writes 7 | wal_compression = off # enable compression of full-page writes 8 | wal_log_hints = on # also do full page writes of non-critical updates 9 | max_wal_size = 1GB 10 | min_wal_size = 80MB 11 | log_destination = 'stderr' # Valid values are combinations of 12 | log_min_messages = info 13 | log_min_duration_statement = 0 # 0 logs all statements 14 | log_checkpoints = on 15 | log_connections = on 16 | log_disconnections = on 17 | log_replication_commands = on 18 | log_timezone = 'Etc/UTC' 19 | datestyle = 'iso, mdy' 20 | timezone = 'Etc/UTC' 21 | 22 | # These settings are initialized by initdb, but they can be changed. 23 | lc_messages = 'en_US.utf8' # locale for system error message 24 | lc_monetary = 'en_US.utf8' # locale for monetary formatting 25 | lc_numeric = 'en_US.utf8' # locale for number formatting 26 | lc_time = 'en_US.utf8' # locale for time formatting 27 | 28 | # default configuration for text search 29 | default_text_search_config = 'pg_catalog.english' 30 | -------------------------------------------------------------------------------- /docker/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | --- 2 | global: 3 | scrape_interval: 5s 4 | 5 | rule_files: 6 | - /etc/prometheus/rules.yml 7 | 8 | scrape_configs: 9 | - job_name: pgsink 10 | static_configs: 11 | - targets: ["host.docker.internal:9525"] 12 | relabel_configs: &relabel 13 | - source_labels: [__address__] 14 | regex: .+:(\d+) 15 | target_label: port 16 | replacement: ${1} 17 | - source_labels: [__address__] 18 | regex: (.+):\d+ 19 | target_label: instance 20 | replacement: ${1} 21 | -------------------------------------------------------------------------------- /docker/prometheus/rules.yml: -------------------------------------------------------------------------------- 1 | --- 2 | groups: 3 | - name: pgsink.rules 4 | rules: [] # TODO 5 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lawrencejones/pgsink 2 | 3 | go 1.16 4 | 5 | require ( 6 | cloud.google.com/go/bigquery v1.18.0 7 | contrib.go.opencensus.io/exporter/jaeger v0.2.0 8 | contrib.go.opencensus.io/exporter/stackdriver v0.13.5 9 | contrib.go.opencensus.io/integrations/ocsql v0.1.7 10 | github.com/Masterminds/goutils v1.1.0 // indirect 11 | github.com/Masterminds/semver v1.5.0 // indirect 12 | github.com/Masterminds/sprig v2.22.0+incompatible 13 | github.com/alecthomas/kingpin v2.2.6+incompatible 14 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 15 | github.com/davecgh/go-spew v1.1.1 16 | github.com/getsentry/sentry-go v0.9.0 17 | github.com/go-jet/jet/v2 v2.4.0 18 | github.com/go-kit/kit v0.10.0 19 | github.com/google/uuid v1.3.0 20 | github.com/hashicorp/go-cleanhttp v0.5.2 21 | github.com/huandu/xstrings v1.3.2 // indirect 22 | github.com/imdario/mergo v0.3.11 // indirect 23 | github.com/jackc/pgconn v1.10.1 24 | github.com/jackc/pglogrepl v0.0.0-20200309144228-32ec418076b3 25 | github.com/jackc/pgproto3/v2 v2.2.0 26 | github.com/jackc/pgtype v1.9.1 27 | github.com/jackc/pgx/v4 v4.14.1 28 | github.com/mitchellh/copystructure v1.0.0 // indirect 29 | github.com/oklog/run v1.1.0 30 | github.com/onsi/ginkgo v1.16.2 31 | github.com/onsi/gomega v1.13.0 32 | github.com/pkg/errors v0.9.1 33 | github.com/pressly/goose v2.7.0+incompatible 34 | github.com/prometheus/client_golang v1.12.1 35 | go.opencensus.io v0.23.0 36 | goa.design/goa/v3 v3.5.4 37 | golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed // indirect 38 | golang.org/x/tools v0.1.9 39 | google.golang.org/api v0.52.0 40 | ) 41 | -------------------------------------------------------------------------------- /goreleaser.yml: -------------------------------------------------------------------------------- 1 | # View goreleaser docs for configuration settings 2 | # https://goreleaser.com 3 | 4 | --- 5 | project_name: pgsink 6 | 7 | builds: 8 | - binary: pgsink 9 | main: cmd/pgsink/main.go 10 | goos: 11 | - darwin 12 | - linux 13 | goarch: 14 | - amd64 15 | ldflags: > 16 | -X github.com/lawrencejones/pgsink/cmd/pgsink/cmd.Version={{.Version}} 17 | -X github.com/lawrencejones/pgsink/cmd/pgsink/cmd.Commit={{.Commit}} 18 | -X github.com/lawrencejones/pgsink/cmd/pgsink/cmd.Date={{.Date}} 19 | -a 20 | -installsuffix cgo 21 | env: 22 | # Ensure what we link is available even without libc. 23 | - CGO_ENABLED=0 24 | # Set this so we can run specific pre-flights for whenever goreleaser is 25 | # active. 26 | - GORELEASER=true 27 | 28 | nfpms: 29 | - vendor: lawrencejones.dev 30 | homepage: https://github.com/lawrencejones/pgsink 31 | maintainer: Lawrence Jones me@lawrencejones.dev 32 | description: > 33 | Logically replicate data out of Postgres into sinks (files, Google 34 | BigQuery, etc) 35 | formats: 36 | - deb 37 | -------------------------------------------------------------------------------- /integration/suite_test.go: -------------------------------------------------------------------------------- 1 | package integration 2 | 3 | import ( 4 | "testing" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | "github.com/onsi/gomega/gexec" 11 | ) 12 | 13 | var ( 14 | logger = kitlog.NewLogfmtLogger(GinkgoWriter) 15 | binary string 16 | 17 | _ = BeforeSuite(func() { 18 | var err error 19 | binary, err = gexec.Build("github.com/lawrencejones/pgsink/cmd/pgsink") 20 | Expect(err).NotTo(HaveOccurred(), "failed to compile pgsink") 21 | }) 22 | _ = AfterSuite(func() { 23 | gexec.CleanupBuildArtifacts() 24 | }) 25 | ) 26 | 27 | func TestSuite(t *testing.T) { 28 | RegisterFailHandler(Fail) 29 | RunSpecs(t, "integration") 30 | } 31 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/administrable_role_authorizations.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type AdministrableRoleAuthorizations struct { 11 | Grantee *string 12 | RoleName *string 13 | IsGrantable *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/applicable_roles.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ApplicableRoles struct { 11 | Grantee *string 12 | RoleName *string 13 | IsGrantable *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/attributes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Attributes struct { 11 | UdtCatalog *string 12 | UdtSchema *string 13 | UdtName *string 14 | AttributeName *string 15 | OrdinalPosition *int32 16 | AttributeDefault *string 17 | IsNullable *string 18 | DataType *string 19 | CharacterMaximumLength *int32 20 | CharacterOctetLength *int32 21 | CharacterSetCatalog *string 22 | CharacterSetSchema *string 23 | CharacterSetName *string 24 | CollationCatalog *string 25 | CollationSchema *string 26 | CollationName *string 27 | NumericPrecision *int32 28 | NumericPrecisionRadix *int32 29 | NumericScale *int32 30 | DatetimePrecision *int32 31 | IntervalType *string 32 | IntervalPrecision *int32 33 | AttributeUdtCatalog *string 34 | AttributeUdtSchema *string 35 | AttributeUdtName *string 36 | ScopeCatalog *string 37 | ScopeSchema *string 38 | ScopeName *string 39 | MaximumCardinality *int32 40 | DtdIdentifier *string 41 | IsDerivedReferenceAttribute *string 42 | } 43 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/character_sets.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type CharacterSets struct { 11 | CharacterSetCatalog *string 12 | CharacterSetSchema *string 13 | CharacterSetName *string 14 | CharacterRepertoire *string 15 | FormOfUse *string 16 | DefaultCollateCatalog *string 17 | DefaultCollateSchema *string 18 | DefaultCollateName *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/check_constraint_routine_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type CheckConstraintRoutineUsage struct { 11 | ConstraintCatalog *string 12 | ConstraintSchema *string 13 | ConstraintName *string 14 | SpecificCatalog *string 15 | SpecificSchema *string 16 | SpecificName *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/check_constraints.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type CheckConstraints struct { 11 | ConstraintCatalog *string 12 | ConstraintSchema *string 13 | ConstraintName *string 14 | CheckClause *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/collation_character_set_applicability.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type CollationCharacterSetApplicability struct { 11 | CollationCatalog *string 12 | CollationSchema *string 13 | CollationName *string 14 | CharacterSetCatalog *string 15 | CharacterSetSchema *string 16 | CharacterSetName *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/collations.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Collations struct { 11 | CollationCatalog *string 12 | CollationSchema *string 13 | CollationName *string 14 | PadAttribute *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/column_column_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ColumnColumnUsage struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | ColumnName *string 15 | DependentColumn *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/column_domain_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ColumnDomainUsage struct { 11 | DomainCatalog *string 12 | DomainSchema *string 13 | DomainName *string 14 | TableCatalog *string 15 | TableSchema *string 16 | TableName *string 17 | ColumnName *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/column_options.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ColumnOptions struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | ColumnName *string 15 | OptionName *string 16 | OptionValue *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/column_privileges.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ColumnPrivileges struct { 11 | Grantor *string 12 | Grantee *string 13 | TableCatalog *string 14 | TableSchema *string 15 | TableName *string 16 | ColumnName *string 17 | PrivilegeType *string 18 | IsGrantable *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/column_udt_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ColumnUdtUsage struct { 11 | UdtCatalog *string 12 | UdtSchema *string 13 | UdtName *string 14 | TableCatalog *string 15 | TableSchema *string 16 | TableName *string 17 | ColumnName *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/columns.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Columns struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | ColumnName *string 15 | OrdinalPosition *int32 16 | ColumnDefault *string 17 | IsNullable *string 18 | DataType *string 19 | CharacterMaximumLength *int32 20 | CharacterOctetLength *int32 21 | NumericPrecision *int32 22 | NumericPrecisionRadix *int32 23 | NumericScale *int32 24 | DatetimePrecision *int32 25 | IntervalType *string 26 | IntervalPrecision *int32 27 | CharacterSetCatalog *string 28 | CharacterSetSchema *string 29 | CharacterSetName *string 30 | CollationCatalog *string 31 | CollationSchema *string 32 | CollationName *string 33 | DomainCatalog *string 34 | DomainSchema *string 35 | DomainName *string 36 | UdtCatalog *string 37 | UdtSchema *string 38 | UdtName *string 39 | ScopeCatalog *string 40 | ScopeSchema *string 41 | ScopeName *string 42 | MaximumCardinality *int32 43 | DtdIdentifier *string 44 | IsSelfReferencing *string 45 | IsIdentity *string 46 | IdentityGeneration *string 47 | IdentityStart *string 48 | IdentityIncrement *string 49 | IdentityMaximum *string 50 | IdentityMinimum *string 51 | IdentityCycle *string 52 | IsGenerated *string 53 | GenerationExpression *string 54 | IsUpdatable *string 55 | } 56 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/constraint_column_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ConstraintColumnUsage struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | ColumnName *string 15 | ConstraintCatalog *string 16 | ConstraintSchema *string 17 | ConstraintName *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/constraint_table_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ConstraintTableUsage struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | ConstraintCatalog *string 15 | ConstraintSchema *string 16 | ConstraintName *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/data_type_privileges.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type DataTypePrivileges struct { 11 | ObjectCatalog *string 12 | ObjectSchema *string 13 | ObjectName *string 14 | ObjectType *string 15 | DtdIdentifier *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/domain_constraints.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type DomainConstraints struct { 11 | ConstraintCatalog *string 12 | ConstraintSchema *string 13 | ConstraintName *string 14 | DomainCatalog *string 15 | DomainSchema *string 16 | DomainName *string 17 | IsDeferrable *string 18 | InitiallyDeferred *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/domain_udt_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type DomainUdtUsage struct { 11 | UdtCatalog *string 12 | UdtSchema *string 13 | UdtName *string 14 | DomainCatalog *string 15 | DomainSchema *string 16 | DomainName *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/domains.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Domains struct { 11 | DomainCatalog *string 12 | DomainSchema *string 13 | DomainName *string 14 | DataType *string 15 | CharacterMaximumLength *int32 16 | CharacterOctetLength *int32 17 | CharacterSetCatalog *string 18 | CharacterSetSchema *string 19 | CharacterSetName *string 20 | CollationCatalog *string 21 | CollationSchema *string 22 | CollationName *string 23 | NumericPrecision *int32 24 | NumericPrecisionRadix *int32 25 | NumericScale *int32 26 | DatetimePrecision *int32 27 | IntervalType *string 28 | IntervalPrecision *int32 29 | DomainDefault *string 30 | UdtCatalog *string 31 | UdtSchema *string 32 | UdtName *string 33 | ScopeCatalog *string 34 | ScopeSchema *string 35 | ScopeName *string 36 | MaximumCardinality *int32 37 | DtdIdentifier *string 38 | } 39 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/element_types.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ElementTypes struct { 11 | ObjectCatalog *string 12 | ObjectSchema *string 13 | ObjectName *string 14 | ObjectType *string 15 | CollectionTypeIdentifier *string 16 | DataType *string 17 | CharacterMaximumLength *int32 18 | CharacterOctetLength *int32 19 | CharacterSetCatalog *string 20 | CharacterSetSchema *string 21 | CharacterSetName *string 22 | CollationCatalog *string 23 | CollationSchema *string 24 | CollationName *string 25 | NumericPrecision *int32 26 | NumericPrecisionRadix *int32 27 | NumericScale *int32 28 | DatetimePrecision *int32 29 | IntervalType *string 30 | IntervalPrecision *int32 31 | DomainDefault *string 32 | UdtCatalog *string 33 | UdtSchema *string 34 | UdtName *string 35 | ScopeCatalog *string 36 | ScopeSchema *string 37 | ScopeName *string 38 | MaximumCardinality *int32 39 | DtdIdentifier *string 40 | } 41 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/enabled_roles.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type EnabledRoles struct { 11 | RoleName *string 12 | } 13 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/foreign_data_wrapper_options.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ForeignDataWrapperOptions struct { 11 | ForeignDataWrapperCatalog *string 12 | ForeignDataWrapperName *string 13 | OptionName *string 14 | OptionValue *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/foreign_data_wrappers.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ForeignDataWrappers struct { 11 | ForeignDataWrapperCatalog *string 12 | ForeignDataWrapperName *string 13 | AuthorizationIdentifier *string 14 | LibraryName *string 15 | ForeignDataWrapperLanguage *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/foreign_server_options.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ForeignServerOptions struct { 11 | ForeignServerCatalog *string 12 | ForeignServerName *string 13 | OptionName *string 14 | OptionValue *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/foreign_servers.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ForeignServers struct { 11 | ForeignServerCatalog *string 12 | ForeignServerName *string 13 | ForeignDataWrapperCatalog *string 14 | ForeignDataWrapperName *string 15 | ForeignServerType *string 16 | ForeignServerVersion *string 17 | AuthorizationIdentifier *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/foreign_table_options.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ForeignTableOptions struct { 11 | ForeignTableCatalog *string 12 | ForeignTableSchema *string 13 | ForeignTableName *string 14 | OptionName *string 15 | OptionValue *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/foreign_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ForeignTables struct { 11 | ForeignTableCatalog *string 12 | ForeignTableSchema *string 13 | ForeignTableName *string 14 | ForeignServerCatalog *string 15 | ForeignServerName *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/information_schema_catalog_name.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type InformationSchemaCatalogName struct { 11 | CatalogName *string 12 | } 13 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/key_column_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type KeyColumnUsage struct { 11 | ConstraintCatalog *string 12 | ConstraintSchema *string 13 | ConstraintName *string 14 | TableCatalog *string 15 | TableSchema *string 16 | TableName *string 17 | ColumnName *string 18 | OrdinalPosition *int32 19 | PositionInUniqueConstraint *int32 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/parameters.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Parameters struct { 11 | SpecificCatalog *string 12 | SpecificSchema *string 13 | SpecificName *string 14 | OrdinalPosition *int32 15 | ParameterMode *string 16 | IsResult *string 17 | AsLocator *string 18 | ParameterName *string 19 | DataType *string 20 | CharacterMaximumLength *int32 21 | CharacterOctetLength *int32 22 | CharacterSetCatalog *string 23 | CharacterSetSchema *string 24 | CharacterSetName *string 25 | CollationCatalog *string 26 | CollationSchema *string 27 | CollationName *string 28 | NumericPrecision *int32 29 | NumericPrecisionRadix *int32 30 | NumericScale *int32 31 | DatetimePrecision *int32 32 | IntervalType *string 33 | IntervalPrecision *int32 34 | UdtCatalog *string 35 | UdtSchema *string 36 | UdtName *string 37 | ScopeCatalog *string 38 | ScopeSchema *string 39 | ScopeName *string 40 | MaximumCardinality *int32 41 | DtdIdentifier *string 42 | ParameterDefault *string 43 | } 44 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/referential_constraints.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ReferentialConstraints struct { 11 | ConstraintCatalog *string 12 | ConstraintSchema *string 13 | ConstraintName *string 14 | UniqueConstraintCatalog *string 15 | UniqueConstraintSchema *string 16 | UniqueConstraintName *string 17 | MatchOption *string 18 | UpdateRule *string 19 | DeleteRule *string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/role_column_grants.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type RoleColumnGrants struct { 11 | Grantor *string 12 | Grantee *string 13 | TableCatalog *string 14 | TableSchema *string 15 | TableName *string 16 | ColumnName *string 17 | PrivilegeType *string 18 | IsGrantable *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/role_routine_grants.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type RoleRoutineGrants struct { 11 | Grantor *string 12 | Grantee *string 13 | SpecificCatalog *string 14 | SpecificSchema *string 15 | SpecificName *string 16 | RoutineCatalog *string 17 | RoutineSchema *string 18 | RoutineName *string 19 | PrivilegeType *string 20 | IsGrantable *string 21 | } 22 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/role_table_grants.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type RoleTableGrants struct { 11 | Grantor *string 12 | Grantee *string 13 | TableCatalog *string 14 | TableSchema *string 15 | TableName *string 16 | PrivilegeType *string 17 | IsGrantable *string 18 | WithHierarchy *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/role_udt_grants.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type RoleUdtGrants struct { 11 | Grantor *string 12 | Grantee *string 13 | UdtCatalog *string 14 | UdtSchema *string 15 | UdtName *string 16 | PrivilegeType *string 17 | IsGrantable *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/role_usage_grants.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type RoleUsageGrants struct { 11 | Grantor *string 12 | Grantee *string 13 | ObjectCatalog *string 14 | ObjectSchema *string 15 | ObjectName *string 16 | ObjectType *string 17 | PrivilegeType *string 18 | IsGrantable *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/routine_privileges.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type RoutinePrivileges struct { 11 | Grantor *string 12 | Grantee *string 13 | SpecificCatalog *string 14 | SpecificSchema *string 15 | SpecificName *string 16 | RoutineCatalog *string 17 | RoutineSchema *string 18 | RoutineName *string 19 | PrivilegeType *string 20 | IsGrantable *string 21 | } 22 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/schemata.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Schemata struct { 11 | CatalogName *string 12 | SchemaName *string 13 | SchemaOwner *string 14 | DefaultCharacterSetCatalog *string 15 | DefaultCharacterSetSchema *string 16 | DefaultCharacterSetName *string 17 | SQLPath *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/sequences.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Sequences struct { 11 | SequenceCatalog *string 12 | SequenceSchema *string 13 | SequenceName *string 14 | DataType *string 15 | NumericPrecision *int32 16 | NumericPrecisionRadix *int32 17 | NumericScale *int32 18 | StartValue *string 19 | MinimumValue *string 20 | MaximumValue *string 21 | Increment *string 22 | CycleOption *string 23 | } 24 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/sql_features.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type SQLFeatures struct { 11 | FeatureID *string 12 | FeatureName *string 13 | SubFeatureID *string 14 | SubFeatureName *string 15 | IsSupported *string 16 | IsVerifiedBy *string 17 | Comments *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/sql_implementation_info.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type SQLImplementationInfo struct { 11 | ImplementationInfoID *string 12 | ImplementationInfoName *string 13 | IntegerValue *int32 14 | CharacterValue *string 15 | Comments *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/sql_sizing.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type SQLSizing struct { 11 | SizingID *int32 12 | SizingName *string 13 | SupportedValue *int32 14 | Comments *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/table_constraints.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type TableConstraints struct { 11 | ConstraintCatalog *string 12 | ConstraintSchema *string 13 | ConstraintName *string 14 | TableCatalog *string 15 | TableSchema *string 16 | TableName *string 17 | ConstraintType *string 18 | IsDeferrable *string 19 | InitiallyDeferred *string 20 | Enforced *string 21 | } 22 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/table_privileges.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type TablePrivileges struct { 11 | Grantor *string 12 | Grantee *string 13 | TableCatalog *string 14 | TableSchema *string 15 | TableName *string 16 | PrivilegeType *string 17 | IsGrantable *string 18 | WithHierarchy *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Tables struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | TableType *string 15 | SelfReferencingColumnName *string 16 | ReferenceGeneration *string 17 | UserDefinedTypeCatalog *string 18 | UserDefinedTypeSchema *string 19 | UserDefinedTypeName *string 20 | IsInsertableInto *string 21 | IsTyped *string 22 | CommitAction *string 23 | } 24 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/triggered_update_columns.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type TriggeredUpdateColumns struct { 11 | TriggerCatalog *string 12 | TriggerSchema *string 13 | TriggerName *string 14 | EventObjectCatalog *string 15 | EventObjectSchema *string 16 | EventObjectTable *string 17 | EventObjectColumn *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/triggers.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type Triggers struct { 15 | TriggerCatalog *string 16 | TriggerSchema *string 17 | TriggerName *string 18 | EventManipulation *string 19 | EventObjectCatalog *string 20 | EventObjectSchema *string 21 | EventObjectTable *string 22 | ActionOrder *int32 23 | ActionCondition *string 24 | ActionStatement *string 25 | ActionOrientation *string 26 | ActionTiming *string 27 | ActionReferenceOldTable *string 28 | ActionReferenceNewTable *string 29 | ActionReferenceOldRow *string 30 | ActionReferenceNewRow *string 31 | Created *time.Time 32 | } 33 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/udt_privileges.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type UdtPrivileges struct { 11 | Grantor *string 12 | Grantee *string 13 | UdtCatalog *string 14 | UdtSchema *string 15 | UdtName *string 16 | PrivilegeType *string 17 | IsGrantable *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/usage_privileges.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type UsagePrivileges struct { 11 | Grantor *string 12 | Grantee *string 13 | ObjectCatalog *string 14 | ObjectSchema *string 15 | ObjectName *string 16 | ObjectType *string 17 | PrivilegeType *string 18 | IsGrantable *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/user_defined_types.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type UserDefinedTypes struct { 11 | UserDefinedTypeCatalog *string 12 | UserDefinedTypeSchema *string 13 | UserDefinedTypeName *string 14 | UserDefinedTypeCategory *string 15 | IsInstantiable *string 16 | IsFinal *string 17 | OrderingForm *string 18 | OrderingCategory *string 19 | OrderingRoutineCatalog *string 20 | OrderingRoutineSchema *string 21 | OrderingRoutineName *string 22 | ReferenceType *string 23 | DataType *string 24 | CharacterMaximumLength *int32 25 | CharacterOctetLength *int32 26 | CharacterSetCatalog *string 27 | CharacterSetSchema *string 28 | CharacterSetName *string 29 | CollationCatalog *string 30 | CollationSchema *string 31 | CollationName *string 32 | NumericPrecision *int32 33 | NumericPrecisionRadix *int32 34 | NumericScale *int32 35 | DatetimePrecision *int32 36 | IntervalType *string 37 | IntervalPrecision *int32 38 | SourceDtdIdentifier *string 39 | RefDtdIdentifier *string 40 | } 41 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/user_mapping_options.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type UserMappingOptions struct { 11 | AuthorizationIdentifier *string 12 | ForeignServerCatalog *string 13 | ForeignServerName *string 14 | OptionName *string 15 | OptionValue *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/user_mappings.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type UserMappings struct { 11 | AuthorizationIdentifier *string 12 | ForeignServerCatalog *string 13 | ForeignServerName *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/view_column_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ViewColumnUsage struct { 11 | ViewCatalog *string 12 | ViewSchema *string 13 | ViewName *string 14 | TableCatalog *string 15 | TableSchema *string 16 | TableName *string 17 | ColumnName *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/view_routine_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ViewRoutineUsage struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | SpecificCatalog *string 15 | SpecificSchema *string 16 | SpecificName *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/view_table_usage.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type ViewTableUsage struct { 11 | ViewCatalog *string 12 | ViewSchema *string 13 | ViewName *string 14 | TableCatalog *string 15 | TableSchema *string 16 | TableName *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/model/views.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type Views struct { 11 | TableCatalog *string 12 | TableSchema *string 13 | TableName *string 14 | ViewDefinition *string 15 | CheckOption *string 16 | IsUpdatable *string 17 | IsInsertableInto *string 18 | IsTriggerUpdatable *string 19 | IsTriggerDeletable *string 20 | IsTriggerInsertableInto *string 21 | } 22 | -------------------------------------------------------------------------------- /internal/dbschema/information_schema/view/enabled_roles.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package view 9 | 10 | import ( 11 | "github.com/go-jet/jet/v2/postgres" 12 | ) 13 | 14 | var EnabledRoles = newEnabledRolesTable() 15 | 16 | type enabledRolesTable struct { 17 | postgres.Table 18 | 19 | //Columns 20 | RoleName postgres.ColumnString 21 | 22 | AllColumns postgres.ColumnList 23 | MutableColumns postgres.ColumnList 24 | } 25 | 26 | type EnabledRolesTable struct { 27 | enabledRolesTable 28 | 29 | EXCLUDED enabledRolesTable 30 | } 31 | 32 | // AS creates new EnabledRolesTable with assigned alias 33 | func (a *EnabledRolesTable) AS(alias string) *EnabledRolesTable { 34 | aliasTable := newEnabledRolesTable() 35 | aliasTable.Table.AS(alias) 36 | return aliasTable 37 | } 38 | 39 | func newEnabledRolesTable() *EnabledRolesTable { 40 | return &EnabledRolesTable{ 41 | enabledRolesTable: newEnabledRolesTableImpl("information_schema", "enabled_roles"), 42 | EXCLUDED: newEnabledRolesTableImpl("", "excluded"), 43 | } 44 | } 45 | 46 | func newEnabledRolesTableImpl(schemaName, tableName string) enabledRolesTable { 47 | var ( 48 | RoleNameColumn = postgres.StringColumn("role_name") 49 | allColumns = postgres.ColumnList{RoleNameColumn} 50 | mutableColumns = postgres.ColumnList{RoleNameColumn} 51 | ) 52 | 53 | return enabledRolesTable{ 54 | Table: postgres.NewTable(schemaName, tableName, allColumns...), 55 | 56 | //Columns 57 | RoleName: RoleNameColumn, 58 | 59 | AllColumns: allColumns, 60 | MutableColumns: mutableColumns, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_aggregate.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAggregate struct { 11 | Aggfnoid string 12 | Aggkind string 13 | Aggnumdirectargs int16 14 | Aggtransfn string 15 | Aggfinalfn string 16 | Aggcombinefn string 17 | Aggserialfn string 18 | Aggdeserialfn string 19 | Aggmtransfn string 20 | Aggminvtransfn string 21 | Aggmfinalfn string 22 | Aggfinalextra bool 23 | Aggmfinalextra bool 24 | Aggfinalmodify string 25 | Aggmfinalmodify string 26 | Aggsortop string 27 | Aggtranstype string 28 | Aggtransspace int32 29 | Aggmtranstype string 30 | Aggmtransspace int32 31 | Agginitval *string 32 | Aggminitval *string 33 | } 34 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_am.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAm struct { 11 | Oid string 12 | Amname string 13 | Amhandler string 14 | Amtype string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_amop.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAmop struct { 11 | Oid string 12 | Amopfamily string 13 | Amoplefttype string 14 | Amoprighttype string 15 | Amopstrategy int16 16 | Amoppurpose string 17 | Amopopr string 18 | Amopmethod string 19 | Amopsortfamily string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_amproc.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAmproc struct { 11 | Oid string 12 | Amprocfamily string 13 | Amproclefttype string 14 | Amprocrighttype string 15 | Amprocnum int16 16 | Amproc string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_attrdef.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAttrdef struct { 11 | Oid string 12 | Adrelid string 13 | Adnum int16 14 | Adbin string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_attribute.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAttribute struct { 11 | Attrelid string 12 | Attname string 13 | Atttypid string 14 | Attstattarget int32 15 | Attlen int16 16 | Attnum int16 17 | Attndims int32 18 | Attcacheoff int32 19 | Atttypmod int32 20 | Attbyval bool 21 | Attstorage string 22 | Attalign string 23 | Attnotnull bool 24 | Atthasdef bool 25 | Atthasmissing bool 26 | Attidentity string 27 | Attgenerated string 28 | Attisdropped bool 29 | Attislocal bool 30 | Attinhcount int32 31 | Attcollation string 32 | Attacl *string 33 | Attoptions *string 34 | Attfdwoptions *string 35 | Attmissingval *string 36 | } 37 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_auth_members.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAuthMembers struct { 11 | Roleid string 12 | Member string 13 | Grantor string 14 | AdminOption bool 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_available_extension_versions.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAvailableExtensionVersions struct { 11 | Name *string 12 | Version *string 13 | Installed *bool 14 | Superuser *bool 15 | Trusted *bool 16 | Relocatable *bool 17 | Schema *string 18 | Requires *string 19 | Comment *string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_available_extensions.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgAvailableExtensions struct { 11 | Name *string 12 | DefaultVersion *string 13 | InstalledVersion *string 14 | Comment *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_cast.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgCast struct { 11 | Oid string 12 | Castsource string 13 | Casttarget string 14 | Castfunc string 15 | Castcontext string 16 | Castmethod string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_class.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgClass struct { 11 | Oid string 12 | Relname string 13 | Relnamespace string 14 | Reltype string 15 | Reloftype string 16 | Relowner string 17 | Relam string 18 | Relfilenode string 19 | Reltablespace string 20 | Relpages int32 21 | Reltuples float32 22 | Relallvisible int32 23 | Reltoastrelid string 24 | Relhasindex bool 25 | Relisshared bool 26 | Relpersistence string 27 | Relkind string 28 | Relnatts int16 29 | Relchecks int16 30 | Relhasrules bool 31 | Relhastriggers bool 32 | Relhassubclass bool 33 | Relrowsecurity bool 34 | Relforcerowsecurity bool 35 | Relispopulated bool 36 | Relreplident string 37 | Relispartition bool 38 | Relrewrite string 39 | Relfrozenxid string 40 | Relminmxid string 41 | Relacl *string 42 | Reloptions *string 43 | Relpartbound *string 44 | } 45 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_collation.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgCollation struct { 11 | Oid string 12 | Collname string 13 | Collnamespace string 14 | Collowner string 15 | Collprovider string 16 | Collisdeterministic bool 17 | Collencoding int32 18 | Collcollate string 19 | Collctype string 20 | Collversion *string 21 | } 22 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_constraint.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgConstraint struct { 11 | Oid string 12 | Conname string 13 | Connamespace string 14 | Contype string 15 | Condeferrable bool 16 | Condeferred bool 17 | Convalidated bool 18 | Conrelid string 19 | Contypid string 20 | Conindid string 21 | Conparentid string 22 | Confrelid string 23 | Confupdtype string 24 | Confdeltype string 25 | Confmatchtype string 26 | Conislocal bool 27 | Coninhcount int32 28 | Connoinherit bool 29 | Conkey *string 30 | Confkey *string 31 | Conpfeqop *string 32 | Conppeqop *string 33 | Conffeqop *string 34 | Conexclop *string 35 | Conbin *string 36 | } 37 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_conversion.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgConversion struct { 11 | Oid string 12 | Conname string 13 | Connamespace string 14 | Conowner string 15 | Conforencoding int32 16 | Contoencoding int32 17 | Conproc string 18 | Condefault bool 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_cursors.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgCursors struct { 15 | Name *string 16 | Statement *string 17 | IsHoldable *bool 18 | IsBinary *bool 19 | IsScrollable *bool 20 | CreationTime *time.Time 21 | } 22 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_database.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgDatabase struct { 11 | Oid string 12 | Datname string 13 | Datdba string 14 | Encoding int32 15 | Datcollate string 16 | Datctype string 17 | Datistemplate bool 18 | Datallowconn bool 19 | Datconnlimit int32 20 | Datlastsysoid string 21 | Datfrozenxid string 22 | Datminmxid string 23 | Dattablespace string 24 | Datacl *string 25 | } 26 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_db_role_setting.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgDbRoleSetting struct { 11 | Setdatabase string 12 | Setrole string 13 | Setconfig *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_default_acl.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgDefaultACL struct { 11 | Oid string 12 | Defaclrole string 13 | Defaclnamespace string 14 | Defaclobjtype string 15 | Defaclacl string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_depend.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgDepend struct { 11 | Classid string 12 | Objid string 13 | Objsubid int32 14 | Refclassid string 15 | Refobjid string 16 | Refobjsubid int32 17 | Deptype string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_description.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgDescription struct { 11 | Objoid string 12 | Classoid string 13 | Objsubid int32 14 | Description string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_enum.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgEnum struct { 11 | Oid string 12 | Enumtypid string 13 | Enumsortorder float32 14 | Enumlabel string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_event_trigger.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgEventTrigger struct { 11 | Oid string 12 | Evtname string 13 | Evtevent string 14 | Evtowner string 15 | Evtfoid string 16 | Evtenabled string 17 | Evttags *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_extension.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgExtension struct { 11 | Oid string 12 | Extname string 13 | Extowner string 14 | Extnamespace string 15 | Extrelocatable bool 16 | Extversion string 17 | Extconfig *string 18 | Extcondition *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_foreign_data_wrapper.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgForeignDataWrapper struct { 11 | Oid string 12 | Fdwname string 13 | Fdwowner string 14 | Fdwhandler string 15 | Fdwvalidator string 16 | Fdwacl *string 17 | Fdwoptions *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_foreign_server.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgForeignServer struct { 11 | Oid string 12 | Srvname string 13 | Srvowner string 14 | Srvfdw string 15 | Srvtype *string 16 | Srvversion *string 17 | Srvacl *string 18 | Srvoptions *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_foreign_table.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgForeignTable struct { 11 | Ftrelid string 12 | Ftserver string 13 | Ftoptions *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_group.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgGroup struct { 11 | Groname *string 12 | Grosysid *string 13 | Grolist *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_index.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgIndex struct { 11 | Indexrelid string 12 | Indrelid string 13 | Indnatts int16 14 | Indnkeyatts int16 15 | Indisunique bool 16 | Indisprimary bool 17 | Indisexclusion bool 18 | Indimmediate bool 19 | Indisclustered bool 20 | Indisvalid bool 21 | Indcheckxmin bool 22 | Indisready bool 23 | Indislive bool 24 | Indisreplident bool 25 | Indkey string 26 | Indcollation string 27 | Indclass string 28 | Indoption string 29 | Indexprs *string 30 | Indpred *string 31 | } 32 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgIndexes struct { 11 | Schemaname *string 12 | Tablename *string 13 | Indexname *string 14 | Tablespace *string 15 | Indexdef *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_inherits.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgInherits struct { 11 | Inhrelid string 12 | Inhparent string 13 | Inhseqno int32 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_init_privs.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgInitPrivs struct { 11 | Objoid string 12 | Classoid string 13 | Objsubid int32 14 | Privtype string 15 | Initprivs string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_language.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgLanguage struct { 11 | Oid string 12 | Lanname string 13 | Lanowner string 14 | Lanispl bool 15 | Lanpltrusted bool 16 | Lanplcallfoid string 17 | Laninline string 18 | Lanvalidator string 19 | Lanacl *string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_largeobject_metadata.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgLargeobjectMetadata struct { 11 | Oid string 12 | Lomowner string 13 | Lomacl *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_locks.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgLocks struct { 11 | Locktype *string 12 | Database *string 13 | Relation *string 14 | Page *int32 15 | Tuple *int16 16 | Virtualxid *string 17 | Transactionid *string 18 | Classid *string 19 | Objid *string 20 | Objsubid *int16 21 | Virtualtransaction *string 22 | Pid *int32 23 | Mode *string 24 | Granted *bool 25 | Fastpath *bool 26 | } 27 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_matviews.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgMatviews struct { 11 | Schemaname *string 12 | Matviewname *string 13 | Matviewowner *string 14 | Tablespace *string 15 | Hasindexes *bool 16 | Ispopulated *bool 17 | Definition *string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_namespace.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgNamespace struct { 11 | Oid string 12 | Nspname string 13 | Nspowner string 14 | Nspacl *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_opclass.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgOpclass struct { 11 | Oid string 12 | Opcmethod string 13 | Opcname string 14 | Opcnamespace string 15 | Opcowner string 16 | Opcfamily string 17 | Opcintype string 18 | Opcdefault bool 19 | Opckeytype string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_operator.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgOperator struct { 11 | Oid string 12 | Oprname string 13 | Oprnamespace string 14 | Oprowner string 15 | Oprkind string 16 | Oprcanmerge bool 17 | Oprcanhash bool 18 | Oprleft string 19 | Oprright string 20 | Oprresult string 21 | Oprcom string 22 | Oprnegate string 23 | Oprcode string 24 | Oprrest string 25 | Oprjoin string 26 | } 27 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_opfamily.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgOpfamily struct { 11 | Oid string 12 | Opfmethod string 13 | Opfname string 14 | Opfnamespace string 15 | Opfowner string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_partitioned_table.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgPartitionedTable struct { 11 | Partrelid string 12 | Partstrat string 13 | Partnatts int16 14 | Partdefid string 15 | Partattrs string 16 | Partclass string 17 | Partcollation string 18 | Partexprs *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_policies.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgPolicies struct { 11 | Schemaname *string 12 | Tablename *string 13 | Policyname *string 14 | Permissive *string 15 | Roles *string 16 | Cmd *string 17 | Qual *string 18 | WithCheck *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_policy.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgPolicy struct { 11 | Oid string 12 | Polname string 13 | Polrelid string 14 | Polcmd string 15 | Polpermissive bool 16 | Polroles string 17 | Polqual *string 18 | Polwithcheck *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_prepared_statements.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgPreparedStatements struct { 15 | Name *string 16 | Statement *string 17 | PrepareTime *time.Time 18 | ParameterTypes *string 19 | FromSQL *bool 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_prepared_xacts.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgPreparedXacts struct { 15 | Transaction *string 16 | Gid *string 17 | Prepared *time.Time 18 | Owner *string 19 | Database *string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_proc.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgProc struct { 11 | Oid string 12 | Proname string 13 | Pronamespace string 14 | Proowner string 15 | Prolang string 16 | Procost float32 17 | Prorows float32 18 | Provariadic string 19 | Prosupport string 20 | Prokind string 21 | Prosecdef bool 22 | Proleakproof bool 23 | Proisstrict bool 24 | Proretset bool 25 | Provolatile string 26 | Proparallel string 27 | Pronargs int16 28 | Pronargdefaults int16 29 | Prorettype string 30 | Proargtypes string 31 | Proallargtypes *string 32 | Proargmodes *string 33 | Proargnames *string 34 | Proargdefaults *string 35 | Protrftypes *string 36 | Prosrc string 37 | Probin *string 38 | Proconfig *string 39 | Proacl *string 40 | } 41 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_publication.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgPublication struct { 11 | Oid string 12 | Pubname string 13 | Pubowner string 14 | Puballtables bool 15 | Pubinsert bool 16 | Pubupdate bool 17 | Pubdelete bool 18 | Pubtruncate bool 19 | Pubviaroot bool 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_publication_rel.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgPublicationRel struct { 11 | Oid string 12 | Prpubid string 13 | Prrelid string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_publication_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgPublicationTables struct { 11 | Pubname *string 12 | Schemaname *string 13 | Tablename *string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_range.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgRange struct { 11 | Rngtypid string 12 | Rngsubtype string 13 | Rngcollation string 14 | Rngsubopc string 15 | Rngcanonical string 16 | Rngsubdiff string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_replication_origin.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgReplicationOrigin struct { 11 | Roident string 12 | Roname string 13 | } 14 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_replication_slots.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgReplicationSlots struct { 11 | SlotName *string 12 | Plugin *string 13 | SlotType *string 14 | Datoid *string 15 | Database *string 16 | Temporary *bool 17 | Active *bool 18 | ActivePid *int32 19 | Xmin *string 20 | CatalogXmin *string 21 | RestartLsn *string 22 | ConfirmedFlushLsn *string 23 | WalStatus *string 24 | SafeWalSize *int64 25 | } 26 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_rewrite.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgRewrite struct { 11 | Oid string 12 | Rulename string 13 | EvClass string 14 | EvType string 15 | EvEnabled string 16 | IsInstead bool 17 | EvQual string 18 | EvAction string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_roles.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgRoles struct { 15 | Rolname *string 16 | Rolsuper *bool 17 | Rolinherit *bool 18 | Rolcreaterole *bool 19 | Rolcreatedb *bool 20 | Rolcanlogin *bool 21 | Rolreplication *bool 22 | Rolconnlimit *int32 23 | Rolpassword *string 24 | Rolvaliduntil *time.Time 25 | Rolbypassrls *bool 26 | Rolconfig *string 27 | Oid *string 28 | } 29 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_rules.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgRules struct { 11 | Schemaname *string 12 | Tablename *string 13 | Rulename *string 14 | Definition *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_seclabel.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSeclabel struct { 11 | Objoid string 12 | Classoid string 13 | Objsubid int32 14 | Provider string 15 | Label string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_seclabels.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSeclabels struct { 11 | Objoid *string 12 | Classoid *string 13 | Objsubid *int32 14 | Objtype *string 15 | Objnamespace *string 16 | Objname *string 17 | Provider *string 18 | Label *string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_sequence.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSequence struct { 11 | Seqrelid string 12 | Seqtypid string 13 | Seqstart int64 14 | Seqincrement int64 15 | Seqmax int64 16 | Seqmin int64 17 | Seqcache int64 18 | Seqcycle bool 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_sequences.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSequences struct { 11 | Schemaname *string 12 | Sequencename *string 13 | Sequenceowner *string 14 | DataType *string 15 | StartValue *int64 16 | MinValue *int64 17 | MaxValue *int64 18 | IncrementBy *int64 19 | Cycle *bool 20 | CacheSize *int64 21 | LastValue *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_settings.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSettings struct { 11 | Name *string 12 | Setting *string 13 | Unit *string 14 | Category *string 15 | ShortDesc *string 16 | ExtraDesc *string 17 | Context *string 18 | Vartype *string 19 | Source *string 20 | MinVal *string 21 | MaxVal *string 22 | Enumvals *string 23 | BootVal *string 24 | ResetVal *string 25 | Sourcefile *string 26 | Sourceline *int32 27 | PendingRestart *bool 28 | } 29 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_shdepend.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgShdepend struct { 11 | Dbid string 12 | Classid string 13 | Objid string 14 | Objsubid int32 15 | Refclassid string 16 | Refobjid string 17 | Deptype string 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_shdescription.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgShdescription struct { 11 | Objoid string 12 | Classoid string 13 | Description string 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_shseclabel.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgShseclabel struct { 11 | Objoid string 12 | Classoid string 13 | Provider string 14 | Label string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_activity.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatActivity struct { 15 | Datid *string 16 | Datname *string 17 | Pid *int32 18 | LeaderPid *int32 19 | Usesysid *string 20 | Usename *string 21 | ApplicationName *string 22 | ClientAddr *string 23 | ClientHostname *string 24 | ClientPort *int32 25 | BackendStart *time.Time 26 | XactStart *time.Time 27 | QueryStart *time.Time 28 | StateChange *time.Time 29 | WaitEventType *string 30 | WaitEvent *string 31 | State *string 32 | BackendXid *string 33 | BackendXmin *string 34 | Query *string 35 | BackendType *string 36 | } 37 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_all_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatAllIndexes struct { 11 | Relid *string 12 | Indexrelid *string 13 | Schemaname *string 14 | Relname *string 15 | Indexrelname *string 16 | IdxScan *int64 17 | IdxTupRead *int64 18 | IdxTupFetch *int64 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_all_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatAllTables struct { 15 | Relid *string 16 | Schemaname *string 17 | Relname *string 18 | SeqScan *int64 19 | SeqTupRead *int64 20 | IdxScan *int64 21 | IdxTupFetch *int64 22 | NTupIns *int64 23 | NTupUpd *int64 24 | NTupDel *int64 25 | NTupHotUpd *int64 26 | NLiveTup *int64 27 | NDeadTup *int64 28 | NModSinceAnalyze *int64 29 | NInsSinceVacuum *int64 30 | LastVacuum *time.Time 31 | LastAutovacuum *time.Time 32 | LastAnalyze *time.Time 33 | LastAutoanalyze *time.Time 34 | VacuumCount *int64 35 | AutovacuumCount *int64 36 | AnalyzeCount *int64 37 | AutoanalyzeCount *int64 38 | } 39 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_archiver.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatArchiver struct { 15 | ArchivedCount *int64 16 | LastArchivedWal *string 17 | LastArchivedTime *time.Time 18 | FailedCount *int64 19 | LastFailedWal *string 20 | LastFailedTime *time.Time 21 | StatsReset *time.Time 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_bgwriter.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatBgwriter struct { 15 | CheckpointsTimed *int64 16 | CheckpointsReq *int64 17 | CheckpointWriteTime *float64 18 | CheckpointSyncTime *float64 19 | BuffersCheckpoint *int64 20 | BuffersClean *int64 21 | MaxwrittenClean *int64 22 | BuffersBackend *int64 23 | BuffersBackendFsync *int64 24 | BuffersAlloc *int64 25 | StatsReset *time.Time 26 | } 27 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_database.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatDatabase struct { 15 | Datid *string 16 | Datname *string 17 | Numbackends *int32 18 | XactCommit *int64 19 | XactRollback *int64 20 | BlksRead *int64 21 | BlksHit *int64 22 | TupReturned *int64 23 | TupFetched *int64 24 | TupInserted *int64 25 | TupUpdated *int64 26 | TupDeleted *int64 27 | Conflicts *int64 28 | TempFiles *int64 29 | TempBytes *int64 30 | Deadlocks *int64 31 | ChecksumFailures *int64 32 | ChecksumLastFailure *time.Time 33 | BlkReadTime *float64 34 | BlkWriteTime *float64 35 | StatsReset *time.Time 36 | } 37 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_database_conflicts.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatDatabaseConflicts struct { 11 | Datid *string 12 | Datname *string 13 | ConflTablespace *int64 14 | ConflLock *int64 15 | ConflSnapshot *int64 16 | ConflBufferpin *int64 17 | ConflDeadlock *int64 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_gssapi.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatGssapi struct { 11 | Pid *int32 12 | GssAuthenticated *bool 13 | Principal *string 14 | Encrypted *bool 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_progress_analyze.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatProgressAnalyze struct { 11 | Pid *int32 12 | Datid *string 13 | Datname *string 14 | Relid *string 15 | Phase *string 16 | SampleBlksTotal *int64 17 | SampleBlksScanned *int64 18 | ExtStatsTotal *int64 19 | ExtStatsComputed *int64 20 | ChildTablesTotal *int64 21 | ChildTablesDone *int64 22 | CurrentChildTableRelid *string 23 | } 24 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_progress_basebackup.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatProgressBasebackup struct { 11 | Pid *int32 12 | Phase *string 13 | BackupTotal *int64 14 | BackupStreamed *int64 15 | TablespacesTotal *int64 16 | TablespacesStreamed *int64 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_progress_cluster.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatProgressCluster struct { 11 | Pid *int32 12 | Datid *string 13 | Datname *string 14 | Relid *string 15 | Command *string 16 | Phase *string 17 | ClusterIndexRelid *string 18 | HeapTuplesScanned *int64 19 | HeapTuplesWritten *int64 20 | HeapBlksTotal *int64 21 | HeapBlksScanned *int64 22 | IndexRebuildCount *int64 23 | } 24 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_progress_create_index.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatProgressCreateIndex struct { 11 | Pid *int32 12 | Datid *string 13 | Datname *string 14 | Relid *string 15 | IndexRelid *string 16 | Command *string 17 | Phase *string 18 | LockersTotal *int64 19 | LockersDone *int64 20 | CurrentLockerPid *int64 21 | BlocksTotal *int64 22 | BlocksDone *int64 23 | TuplesTotal *int64 24 | TuplesDone *int64 25 | PartitionsTotal *int64 26 | PartitionsDone *int64 27 | } 28 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_progress_vacuum.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatProgressVacuum struct { 11 | Pid *int32 12 | Datid *string 13 | Datname *string 14 | Relid *string 15 | Phase *string 16 | HeapBlksTotal *int64 17 | HeapBlksScanned *int64 18 | HeapBlksVacuumed *int64 19 | IndexVacuumCount *int64 20 | MaxDeadTuples *int64 21 | NumDeadTuples *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_replication.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatReplication struct { 15 | Pid *int32 16 | Usesysid *string 17 | Usename *string 18 | ApplicationName *string 19 | ClientAddr *string 20 | ClientHostname *string 21 | ClientPort *int32 22 | BackendStart *time.Time 23 | BackendXmin *string 24 | State *string 25 | SentLsn *string 26 | WriteLsn *string 27 | FlushLsn *string 28 | ReplayLsn *string 29 | WriteLag *string 30 | FlushLag *string 31 | ReplayLag *string 32 | SyncPriority *int32 33 | SyncState *string 34 | ReplyTime *time.Time 35 | } 36 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_slru.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatSlru struct { 15 | Name *string 16 | BlksZeroed *int64 17 | BlksHit *int64 18 | BlksRead *int64 19 | BlksWritten *int64 20 | BlksExists *int64 21 | Flushes *int64 22 | Truncates *int64 23 | StatsReset *time.Time 24 | } 25 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_ssl.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatSsl struct { 11 | Pid *int32 12 | Ssl *bool 13 | Version *string 14 | Cipher *string 15 | Bits *int32 16 | Compression *bool 17 | ClientDn *string 18 | ClientSerial *float64 19 | IssuerDn *string 20 | } 21 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_subscription.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatSubscription struct { 15 | Subid *string 16 | Subname *string 17 | Pid *int32 18 | Relid *string 19 | ReceivedLsn *string 20 | LastMsgSendTime *time.Time 21 | LastMsgReceiptTime *time.Time 22 | LatestEndLsn *string 23 | LatestEndTime *time.Time 24 | } 25 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_sys_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatSysIndexes struct { 11 | Relid *string 12 | Indexrelid *string 13 | Schemaname *string 14 | Relname *string 15 | Indexrelname *string 16 | IdxScan *int64 17 | IdxTupRead *int64 18 | IdxTupFetch *int64 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_sys_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatSysTables struct { 15 | Relid *string 16 | Schemaname *string 17 | Relname *string 18 | SeqScan *int64 19 | SeqTupRead *int64 20 | IdxScan *int64 21 | IdxTupFetch *int64 22 | NTupIns *int64 23 | NTupUpd *int64 24 | NTupDel *int64 25 | NTupHotUpd *int64 26 | NLiveTup *int64 27 | NDeadTup *int64 28 | NModSinceAnalyze *int64 29 | NInsSinceVacuum *int64 30 | LastVacuum *time.Time 31 | LastAutovacuum *time.Time 32 | LastAnalyze *time.Time 33 | LastAutoanalyze *time.Time 34 | VacuumCount *int64 35 | AutovacuumCount *int64 36 | AnalyzeCount *int64 37 | AutoanalyzeCount *int64 38 | } 39 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_user_functions.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatUserFunctions struct { 11 | Funcid *string 12 | Schemaname *string 13 | Funcname *string 14 | Calls *int64 15 | TotalTime *float64 16 | SelfTime *float64 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_user_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatUserIndexes struct { 11 | Relid *string 12 | Indexrelid *string 13 | Schemaname *string 14 | Relname *string 15 | Indexrelname *string 16 | IdxScan *int64 17 | IdxTupRead *int64 18 | IdxTupFetch *int64 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_user_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatUserTables struct { 15 | Relid *string 16 | Schemaname *string 17 | Relname *string 18 | SeqScan *int64 19 | SeqTupRead *int64 20 | IdxScan *int64 21 | IdxTupFetch *int64 22 | NTupIns *int64 23 | NTupUpd *int64 24 | NTupDel *int64 25 | NTupHotUpd *int64 26 | NLiveTup *int64 27 | NDeadTup *int64 28 | NModSinceAnalyze *int64 29 | NInsSinceVacuum *int64 30 | LastVacuum *time.Time 31 | LastAutovacuum *time.Time 32 | LastAnalyze *time.Time 33 | LastAutoanalyze *time.Time 34 | VacuumCount *int64 35 | AutovacuumCount *int64 36 | AnalyzeCount *int64 37 | AutoanalyzeCount *int64 38 | } 39 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_wal_receiver.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgStatWalReceiver struct { 15 | Pid *int32 16 | Status *string 17 | ReceiveStartLsn *string 18 | ReceiveStartTli *int32 19 | WrittenLsn *string 20 | FlushedLsn *string 21 | ReceivedTli *int32 22 | LastMsgSendTime *time.Time 23 | LastMsgReceiptTime *time.Time 24 | LatestEndLsn *string 25 | LatestEndTime *time.Time 26 | SlotName *string 27 | SenderHost *string 28 | SenderPort *int32 29 | Conninfo *string 30 | } 31 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_xact_all_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatXactAllTables struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | SeqScan *int64 15 | SeqTupRead *int64 16 | IdxScan *int64 17 | IdxTupFetch *int64 18 | NTupIns *int64 19 | NTupUpd *int64 20 | NTupDel *int64 21 | NTupHotUpd *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_xact_sys_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatXactSysTables struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | SeqScan *int64 15 | SeqTupRead *int64 16 | IdxScan *int64 17 | IdxTupFetch *int64 18 | NTupIns *int64 19 | NTupUpd *int64 20 | NTupDel *int64 21 | NTupHotUpd *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_xact_user_functions.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatXactUserFunctions struct { 11 | Funcid *string 12 | Schemaname *string 13 | Funcname *string 14 | Calls *int64 15 | TotalTime *float64 16 | SelfTime *float64 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stat_xact_user_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatXactUserTables struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | SeqScan *int64 15 | SeqTupRead *int64 16 | IdxScan *int64 17 | IdxTupFetch *int64 18 | NTupIns *int64 19 | NTupUpd *int64 20 | NTupDel *int64 21 | NTupHotUpd *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_all_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioAllIndexes struct { 11 | Relid *string 12 | Indexrelid *string 13 | Schemaname *string 14 | Relname *string 15 | Indexrelname *string 16 | IdxBlksRead *int64 17 | IdxBlksHit *int64 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_all_sequences.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioAllSequences struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | BlksRead *int64 15 | BlksHit *int64 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_all_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioAllTables struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | HeapBlksRead *int64 15 | HeapBlksHit *int64 16 | IdxBlksRead *int64 17 | IdxBlksHit *int64 18 | ToastBlksRead *int64 19 | ToastBlksHit *int64 20 | TidxBlksRead *int64 21 | TidxBlksHit *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_sys_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioSysIndexes struct { 11 | Relid *string 12 | Indexrelid *string 13 | Schemaname *string 14 | Relname *string 15 | Indexrelname *string 16 | IdxBlksRead *int64 17 | IdxBlksHit *int64 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_sys_sequences.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioSysSequences struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | BlksRead *int64 15 | BlksHit *int64 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_sys_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioSysTables struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | HeapBlksRead *int64 15 | HeapBlksHit *int64 16 | IdxBlksRead *int64 17 | IdxBlksHit *int64 18 | ToastBlksRead *int64 19 | ToastBlksHit *int64 20 | TidxBlksRead *int64 21 | TidxBlksHit *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_user_indexes.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioUserIndexes struct { 11 | Relid *string 12 | Indexrelid *string 13 | Schemaname *string 14 | Relname *string 15 | Indexrelname *string 16 | IdxBlksRead *int64 17 | IdxBlksHit *int64 18 | } 19 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_user_sequences.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioUserSequences struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | BlksRead *int64 15 | BlksHit *int64 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statio_user_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatioUserTables struct { 11 | Relid *string 12 | Schemaname *string 13 | Relname *string 14 | HeapBlksRead *int64 15 | HeapBlksHit *int64 16 | IdxBlksRead *int64 17 | IdxBlksHit *int64 18 | ToastBlksRead *int64 19 | ToastBlksHit *int64 20 | TidxBlksRead *int64 21 | TidxBlksHit *int64 22 | } 23 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_statistic_ext.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatisticExt struct { 11 | Oid string 12 | Stxrelid string 13 | Stxname string 14 | Stxnamespace string 15 | Stxowner string 16 | Stxstattarget int32 17 | Stxkeys string 18 | Stxkind string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stats.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStats struct { 11 | Schemaname *string 12 | Tablename *string 13 | Attname *string 14 | Inherited *bool 15 | NullFrac *float32 16 | AvgWidth *int32 17 | NDistinct *float32 18 | MostCommonVals *string 19 | MostCommonFreqs *string 20 | HistogramBounds *string 21 | Correlation *float32 22 | MostCommonElems *string 23 | MostCommonElemFreqs *string 24 | ElemCountHistogram *string 25 | } 26 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_stats_ext.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgStatsExt struct { 11 | Schemaname *string 12 | Tablename *string 13 | StatisticsSchemaname *string 14 | StatisticsName *string 15 | StatisticsOwner *string 16 | Attnames *string 17 | Kinds *string 18 | NDistinct *string 19 | Dependencies *string 20 | MostCommonVals *string 21 | MostCommonValNulls *string 22 | MostCommonFreqs *string 23 | MostCommonBaseFreqs *string 24 | } 25 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_subscription.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSubscription struct { 11 | Subdbid string 12 | Subname string 13 | Subowner string 14 | Subenabled bool 15 | Subslotname *string 16 | Subpublications string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_subscription_rel.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgSubscriptionRel struct { 11 | Srsubid string 12 | Srrelid string 13 | Srsubstate string 14 | Srsublsn *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_tables.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTables struct { 11 | Schemaname *string 12 | Tablename *string 13 | Tableowner *string 14 | Tablespace *string 15 | Hasindexes *bool 16 | Hasrules *bool 17 | Hastriggers *bool 18 | Rowsecurity *bool 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_tablespace.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTablespace struct { 11 | Oid string 12 | Spcname string 13 | Spcowner string 14 | Spcacl *string 15 | Spcoptions *string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_timezone_abbrevs.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTimezoneAbbrevs struct { 11 | Abbrev *string 12 | UtcOffset *string 13 | IsDst *bool 14 | } 15 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_timezone_names.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTimezoneNames struct { 11 | Name *string 12 | Abbrev *string 13 | UtcOffset *string 14 | IsDst *bool 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_transform.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTransform struct { 11 | Oid string 12 | Trftype string 13 | Trflang string 14 | Trffromsql string 15 | Trftosql string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_trigger.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTrigger struct { 11 | Oid string 12 | Tgrelid string 13 | Tgparentid string 14 | Tgname string 15 | Tgfoid string 16 | Tgtype int16 17 | Tgenabled string 18 | Tgisinternal bool 19 | Tgconstrrelid string 20 | Tgconstrindid string 21 | Tgconstraint string 22 | Tgdeferrable bool 23 | Tginitdeferred bool 24 | Tgnargs int16 25 | Tgattr string 26 | Tgargs []byte 27 | Tgqual *string 28 | Tgoldtable *string 29 | Tgnewtable *string 30 | } 31 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_ts_config.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTsConfig struct { 11 | Oid string 12 | Cfgname string 13 | Cfgnamespace string 14 | Cfgowner string 15 | Cfgparser string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_ts_config_map.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTsConfigMap struct { 11 | Mapcfg string 12 | Maptokentype int32 13 | Mapseqno int32 14 | Mapdict string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_ts_dict.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTsDict struct { 11 | Oid string 12 | Dictname string 13 | Dictnamespace string 14 | Dictowner string 15 | Dicttemplate string 16 | Dictinitoption *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_ts_parser.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTsParser struct { 11 | Oid string 12 | Prsname string 13 | Prsnamespace string 14 | Prsstart string 15 | Prstoken string 16 | Prsend string 17 | Prsheadline string 18 | Prslextype string 19 | } 20 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_ts_template.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgTsTemplate struct { 11 | Oid string 12 | Tmplname string 13 | Tmplnamespace string 14 | Tmplinit string 15 | Tmpllexize string 16 | } 17 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_type.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgType struct { 11 | Oid string 12 | Typname string 13 | Typnamespace string 14 | Typowner string 15 | Typlen int16 16 | Typbyval bool 17 | Typtype string 18 | Typcategory string 19 | Typispreferred bool 20 | Typisdefined bool 21 | Typdelim string 22 | Typrelid string 23 | Typelem string 24 | Typarray string 25 | Typinput string 26 | Typoutput string 27 | Typreceive string 28 | Typsend string 29 | Typmodin string 30 | Typmodout string 31 | Typanalyze string 32 | Typalign string 33 | Typstorage string 34 | Typnotnull bool 35 | Typbasetype string 36 | Typtypmod int32 37 | Typndims int32 38 | Typcollation string 39 | Typdefaultbin *string 40 | Typdefault *string 41 | Typacl *string 42 | } 43 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_user.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type PgUser struct { 15 | Usename *string 16 | Usesysid *string 17 | Usecreatedb *bool 18 | Usesuper *bool 19 | Userepl *bool 20 | Usebypassrls *bool 21 | Passwd *string 22 | Valuntil *time.Time 23 | Useconfig *string 24 | } 25 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_user_mappings.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgUserMappings struct { 11 | Umid *string 12 | Srvid *string 13 | Srvname *string 14 | Umuser *string 15 | Usename *string 16 | Umoptions *string 17 | } 18 | -------------------------------------------------------------------------------- /internal/dbschema/pg_catalog/model/pg_views.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | type PgViews struct { 11 | Schemaname *string 12 | Viewname *string 13 | Viewowner *string 14 | Definition *string 15 | } 16 | -------------------------------------------------------------------------------- /internal/dbschema/pgsink/model/import_jobs.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type ImportJobs struct { 15 | ID int64 `sql:"primary_key"` 16 | SubscriptionID string 17 | TableName string 18 | Cursor *string 19 | CompletedAt *time.Time 20 | ExpiredAt *time.Time 21 | UpdatedAt time.Time 22 | CreatedAt time.Time 23 | Error *string 24 | Schema string 25 | ErrorCount int64 26 | LastErrorAt *time.Time 27 | RowsProcessedTotal int64 28 | } 29 | -------------------------------------------------------------------------------- /internal/dbschema/pgsink/model/schema_migrations.go: -------------------------------------------------------------------------------- 1 | // 2 | // Code generated by go-jet DO NOT EDIT. 3 | // 4 | // WARNING: Changes to this file may cause incorrect behavior 5 | // and will be lost if the code is regenerated 6 | // 7 | 8 | package model 9 | 10 | import ( 11 | "time" 12 | ) 13 | 14 | type SchemaMigrations struct { 15 | ID int32 `sql:"primary_key"` 16 | VersionID int64 17 | IsApplied bool 18 | Tstamp *time.Time 19 | } 20 | -------------------------------------------------------------------------------- /internal/migration/20191229145951_create_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20191229145951, Down20191229145951) 11 | } 12 | 13 | func Up20191229145951(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | create table import_jobs ( 16 | id bigserial primary key, 17 | publication_id text not null, 18 | table_name text not null, 19 | cursor text, 20 | completed_at timestamptz, 21 | created_at timestamptz not null default now() 22 | ); 23 | `) 24 | 25 | return err 26 | } 27 | 28 | func Down20191229145951(tx *sql.Tx) error { 29 | _, err := tx.Exec(` 30 | drop table import_jobs; 31 | `) 32 | 33 | return err 34 | } 35 | -------------------------------------------------------------------------------- /internal/migration/20200107164230_add_error_column_to_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20200107164230, Down20200107164230) 11 | } 12 | 13 | func Up20200107164230(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column error text; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20200107164230(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column error; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20200112133745_add_subscription_name_to_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20200112133745, Down20200112133745) 11 | } 12 | 13 | func Up20200112133745(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column subscription_name text default '' not null; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20200112133745(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column subscription_name; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20200112145911_add_expired_at_to_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20200112145911, Down20200112145911) 11 | } 12 | 13 | func Up20200112145911(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column expired_at timestamptz; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20200112145911(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column expired_at; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20200510142436_drop_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | "errors" 6 | 7 | "github.com/pressly/goose" 8 | ) 9 | 10 | func init() { 11 | goose.AddMigration(Up20200510142436, Down20200510142436) 12 | } 13 | 14 | // Remove the import jobs table in favour of restructuring. We're not at v1.0 yet, so no 15 | // need to maintain compatibility. 16 | func Up20200510142436(tx *sql.Tx) error { 17 | _, err := tx.Exec(` 18 | drop table import_jobs; 19 | `) 20 | 21 | return err 22 | } 23 | 24 | func Down20200510142436(tx *sql.Tx) error { 25 | return errors.New("irreversible") 26 | } 27 | -------------------------------------------------------------------------------- /internal/migration/20200510142527_create_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20200510142527, Down20200510142527) 11 | } 12 | 13 | // Recreate import jobs with a cleaner structure. 14 | func Up20200510142527(tx *sql.Tx) error { 15 | _, err := tx.Exec(` 16 | create table import_jobs ( 17 | id bigserial primary key, 18 | subscription_id text not null, 19 | table_name text not null, 20 | cursor text, 21 | completed_at timestamptz, 22 | expired_at timestamptz, 23 | updated_at timestamptz not null default now(), 24 | created_at timestamptz not null default now() 25 | ); 26 | `) 27 | 28 | return err 29 | } 30 | 31 | func Down20200510142527(tx *sql.Tx) error { 32 | _, err := tx.Exec(` 33 | drop table import_jobs; 34 | `) 35 | 36 | return err 37 | } 38 | -------------------------------------------------------------------------------- /internal/migration/20200525133118_add_error_column_to_import_jobs_table.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20200525133118, Down20200525133118) 11 | } 12 | 13 | func Up20200525133118(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column error text; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20200525133118(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column error text; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20210102200953_add_schema_column_to_import_jobs.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20210102200953, Down20210102200953) 11 | } 12 | 13 | func Up20210102200953(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column schema text not null; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20210102200953(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column schema text; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20210110203230_alter_table_import_jobs_add_error_count.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20210110203230, Down20210110203230) 11 | } 12 | 13 | func Up20210110203230(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column error_count bigint default 0 not null; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20210110203230(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column error_count; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20210110210820_alter_table_import_jobs_add_last_error_at.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pressly/goose" 7 | ) 8 | 9 | func init() { 10 | goose.AddMigration(Up20210110210820, Down20210110210820) 11 | } 12 | 13 | func Up20210110210820(tx *sql.Tx) error { 14 | _, err := tx.Exec(` 15 | alter table import_jobs 16 | add column last_error_at timestamptz; 17 | `) 18 | 19 | return err 20 | } 21 | 22 | func Down20210110210820(tx *sql.Tx) error { 23 | _, err := tx.Exec(` 24 | alter table import_jobs 25 | drop column last_error_at; 26 | `) 27 | 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /internal/migration/20210216150109_alter_table_import_jobs_add_progress.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "database/sql" 5 | "github.com/pressly/goose" 6 | ) 7 | 8 | func init() { 9 | goose.AddMigration(Up20210216150109, Down20210216150109) 10 | } 11 | 12 | func Up20210216150109(tx *sql.Tx) error { 13 | _, err := tx.Exec(` 14 | alter table import_jobs 15 | add column rows_processed_total bigint default 0 not null; 16 | `) 17 | 18 | return err 19 | } 20 | 21 | func Down20210216150109(tx *sql.Tx) error { 22 | _, err := tx.Exec(` 23 | alter table import_jobs 24 | drop column rows_processed_total; 25 | `) 26 | 27 | return err 28 | } 29 | -------------------------------------------------------------------------------- /internal/migration/migration.go: -------------------------------------------------------------------------------- 1 | package migration 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | 10 | kitlog "github.com/go-kit/kit/log" 11 | "github.com/pkg/errors" 12 | "github.com/pressly/goose" 13 | ) 14 | 15 | func Migrate(ctx context.Context, logger kitlog.Logger, db *sql.DB, schemaName string) error { 16 | logger.Log("msg", "initialising schema", "schema", schemaName) 17 | if _, err := db.Exec(fmt.Sprintf(`CREATE SCHEMA IF NOT EXISTS %s;`, schemaName)); err != nil { 18 | return errors.Wrap(err, "failed to create schema") 19 | } 20 | 21 | logger.Log("msg", "running migrations", "schema", schemaName) 22 | goose.SetTableName(fmt.Sprintf("%s.schema_migrations", schemaName)) 23 | 24 | // There is no good reason we have to do this, but goose chokes whenever we give it our 25 | // current directory with "no separator" errors. We don't even use text migrations in 26 | // this project, so create a random scratch directory and remove it as soon as we're 27 | // done. 28 | dir, err := ioutil.TempDir("", "goose-migrations-") 29 | if err != nil { 30 | return errors.Wrap(err, "failed to create scratch migration directory") 31 | } 32 | defer os.RemoveAll(dir) 33 | 34 | if err := goose.Up(db, dir); err != nil { 35 | return errors.Wrap(err, "failed to migrate database") 36 | } 37 | 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /pkg/changelog/changelog.go: -------------------------------------------------------------------------------- 1 | // Defines a changelog Entry, which is a sum type of Schema or Modification. A stream of 2 | // entries is provided as input to sinks, which export the data to the destination target. 3 | // 4 | // Use pkg/subsciption to generate a changelog from a logical replication connection, or 5 | // pkg/imports to load changes from existing Postgres data. 6 | package changelog 7 | -------------------------------------------------------------------------------- /pkg/changelog/entry.go: -------------------------------------------------------------------------------- 1 | package changelog 2 | 3 | // Changelog is the goal of pgsink, a channel of schema and modification messages. Any 4 | // source of these changes, be it a logical replication subscription or an import job, 5 | // must produce this channel. 6 | type Changelog chan Entry 7 | 8 | // Entry is a poor-mans sum type for generic changelog entries 9 | type Entry struct { 10 | *Modification 11 | *Schema 12 | } 13 | 14 | func (e Entry) Unwrap() interface{} { 15 | if e.Modification != nil { 16 | return e.Modification 17 | } else if e.Schema != nil { 18 | return e.Schema 19 | } 20 | 21 | panic("entry has no content") 22 | } 23 | -------------------------------------------------------------------------------- /pkg/changelog/serialize/json.go: -------------------------------------------------------------------------------- 1 | package serialize 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/lawrencejones/pgsink/pkg/changelog" 7 | ) 8 | 9 | var _ Serializer = &JSON{} 10 | 11 | type JSON struct { 12 | Pretty bool // whether to pretty-print the output 13 | } 14 | 15 | func (s *JSON) Register(schema *changelog.Schema) []byte { 16 | bytes, err := json.MarshalIndent(schema, "", " ") 17 | if err != nil { 18 | panic("could not marshal json schema, this should never happen") 19 | } 20 | 21 | return bytes 22 | } 23 | 24 | func (s *JSON) Marshal(modification *changelog.Modification) ([]byte, error) { 25 | if s.Pretty { 26 | return json.MarshalIndent(modification, "", " ") 27 | } 28 | 29 | return json.Marshal(modification) 30 | } 31 | -------------------------------------------------------------------------------- /pkg/changelog/serialize/serialize.go: -------------------------------------------------------------------------------- 1 | package serialize 2 | 3 | import ( 4 | "github.com/lawrencejones/pgsink/pkg/changelog" 5 | ) 6 | 7 | // DefaultSerializer is the serializer of choice, unless it has been overriden 8 | var DefaultSerializer = &JSON{Pretty: true} 9 | 10 | // Serializer defines the required interface for all changelog serializers. 11 | type Serializer interface { 12 | Register(*changelog.Schema) []byte 13 | Marshal(*changelog.Modification) ([]byte, error) 14 | } 15 | -------------------------------------------------------------------------------- /pkg/changelog/suite_test.go: -------------------------------------------------------------------------------- 1 | package changelog_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestSuite(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "pkg/changelog") 13 | } 14 | -------------------------------------------------------------------------------- /pkg/changelog/table.go: -------------------------------------------------------------------------------- 1 | package changelog 2 | 3 | import "fmt" 4 | 5 | // Table uniquely identifies a Postgres table, by both schema and table name. 6 | type Table struct { 7 | Schema string `json:"schema"` 8 | TableName string `json:"table_name"` 9 | } 10 | 11 | func (t Table) String() string { 12 | return fmt.Sprintf("%s.%s", t.Schema, t.TableName) 13 | } 14 | 15 | type Tables []Table 16 | 17 | func (s1 Tables) Diff(s2 Tables) Tables { 18 | result := make([]Table, 0) 19 | for _, s := range s1 { 20 | if !s2.Includes(s) { 21 | result = append(result, s) 22 | } 23 | } 24 | 25 | return result 26 | } 27 | 28 | func (ss Tables) Includes(s Table) bool { 29 | for _, existing := range ss { 30 | if existing.Schema == s.Schema && existing.TableName == s.TableName { 31 | return true 32 | } 33 | } 34 | 35 | return false 36 | } 37 | -------------------------------------------------------------------------------- /pkg/decode/suite_test.go: -------------------------------------------------------------------------------- 1 | package decode_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestSuite(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "pkg/decode") 13 | } 14 | -------------------------------------------------------------------------------- /pkg/imports/suite_test.go: -------------------------------------------------------------------------------- 1 | package imports_test 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | "github.com/lawrencejones/pgsink/internal/dbschema/pgsink/model" 8 | 9 | kitlog "github.com/go-kit/kit/log" 10 | "github.com/jackc/pgx/v4" 11 | 12 | . "github.com/onsi/ginkgo" 13 | . "github.com/onsi/gomega" 14 | ) 15 | 16 | var logger = kitlog.NewLogfmtLogger(GinkgoWriter) 17 | 18 | func TestSuite(t *testing.T) { 19 | RegisterFailHandler(Fail) 20 | RunSpecs(t, "pkg/imports") 21 | } 22 | 23 | type importerFunc func(ctx context.Context, logger kitlog.Logger, tx pgx.Tx, job model.ImportJobs) error 24 | 25 | func (f importerFunc) Do(ctx context.Context, logger kitlog.Logger, tx pgx.Tx, job model.ImportJobs) error { 26 | return f(ctx, logger, tx, job) 27 | } 28 | 29 | func noopImporter(err error) importerFunc { 30 | return importerFunc(func(_ context.Context, _ kitlog.Logger, _ pgx.Tx, _ model.ImportJobs) error { 31 | return err 32 | }) 33 | } 34 | 35 | func waitImporter(ctx context.Context, done chan struct{}, err error) (chan model.ImportJobs, importerFunc) { 36 | acquired := make(chan model.ImportJobs, 1) 37 | return acquired, importerFunc(func(_ context.Context, _ kitlog.Logger, _ pgx.Tx, job model.ImportJobs) error { 38 | acquired <- job 39 | close(acquired) 40 | 41 | select { 42 | case <-ctx.Done(): 43 | case <-done: 44 | } 45 | 46 | return err 47 | }) 48 | } 49 | -------------------------------------------------------------------------------- /pkg/sinks/bigquery/bigquery.go: -------------------------------------------------------------------------------- 1 | // Implements a sink to Google BigQuery, creating a dataset containing raw tables and 2 | // de-duplicated views. The resulting dataset should be queryable as if it were the 3 | // original Postgres database, and should support most queries without change. 4 | package bigquery 5 | -------------------------------------------------------------------------------- /pkg/sinks/bigquery/decoder.go: -------------------------------------------------------------------------------- 1 | package bigquery 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | "time" 7 | 8 | bq "cloud.google.com/go/bigquery" 9 | ) 10 | 11 | // fieldTypeFor maps Postgres OID types to BigQuery types, allowing us to build BigQuery 12 | // schemas from Postgres type information. 13 | func fieldTypeFor(empty interface{}) (fieldType bq.FieldType, repeated bool, err error) { 14 | // We receive an empty paramter, generated from a mapping.NewEmpty, or the destination 15 | // of a scanner. We want to unpack that to get the typed pointer, as the empty value 16 | // will be double pointed. 17 | val := reflect.ValueOf(empty).Elem().Interface() 18 | 19 | switch val.(type) { 20 | case *bool: 21 | return bq.BooleanFieldType, repeated, nil 22 | case *int8, *int16, *int32, *int64: 23 | return bq.IntegerFieldType, repeated, nil 24 | case *uint8, *uint16, *uint32, *uint64: 25 | return bq.IntegerFieldType, repeated, nil 26 | case *float32, *float64: 27 | return bq.FloatFieldType, repeated, nil 28 | case *time.Time: 29 | return bq.TimestampFieldType, repeated, nil 30 | case *string: 31 | return bq.StringFieldType, repeated, nil 32 | } 33 | 34 | // All types that follow must be repeated 35 | repeated = true 36 | 37 | // Composite types 38 | switch val.(type) { 39 | case *[]bool: 40 | return bq.BooleanFieldType, repeated, nil 41 | case *[]int8, *[]int16, *[]int32, *[]int64: 42 | return bq.IntegerFieldType, repeated, nil 43 | case *[]uint8, *[]uint16, *[]uint32, *[]uint64: 44 | return bq.IntegerFieldType, repeated, nil 45 | case *[]float32, *[]float64: 46 | return bq.FloatFieldType, repeated, nil 47 | case *[]time.Time: 48 | return bq.TimestampFieldType, repeated, nil 49 | case *[]string: 50 | return bq.StringFieldType, repeated, nil 51 | } 52 | 53 | return "", false, fmt.Errorf("no BigQuery field for type %T", val) 54 | } 55 | -------------------------------------------------------------------------------- /pkg/sinks/bigquery/decoder_test.go: -------------------------------------------------------------------------------- 1 | package bigquery 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/lawrencejones/pgsink/pkg/decode" 7 | "github.com/lawrencejones/pgsink/pkg/decode/gen/mappings" 8 | . "github.com/onsi/ginkgo" 9 | _ "github.com/onsi/ginkgo/extensions/table" 10 | . "github.com/onsi/gomega" 11 | _ "github.com/onsi/gomega/gstruct" 12 | ) 13 | 14 | // The aim of this test is to ensure anything that can be decoded by the default mappings 15 | // can be supported by the BigQuery sink. Future work will likely push decoding 16 | // constraints back into the decoder, but for now we want to support all the things. 17 | var _ = Describe("fieldTypeFor", func() { 18 | mappings.Each(func(name string, mapping decode.TypeMapping) { 19 | It(fmt.Sprintf("OID %s (%v) is supported", name, mapping.OID), func() { 20 | _, _, err := fieldTypeFor(mapping.NewEmpty()) 21 | Expect(err).NotTo(HaveOccurred()) 22 | }) 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /pkg/sinks/bigquery/suite_test.go: -------------------------------------------------------------------------------- 1 | package bigquery 2 | 3 | import ( 4 | "testing" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | ) 11 | 12 | var logger = kitlog.NewLogfmtLogger(GinkgoWriter) 13 | 14 | func TestSuite(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "pkg/sinks/bigquery") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/sinks/bigquery/testdata/view.dogs.sql: -------------------------------------------------------------------------------- 1 | select payload.*, from ( 2 | select *, row_number() over ( 3 | partition by 4 | 5 | 6 | 7 | payload.tag 8 | 9 | order by timestamp desc 10 | ) as row_number 11 | from `project.dataset.dogs_raw` 12 | ) 13 | where row_number = 1 14 | and operation != 'DELETE' 15 | -------------------------------------------------------------------------------- /pkg/sinks/bigquery/testdata/view.example.sql: -------------------------------------------------------------------------------- 1 | select payload.*, from ( 2 | select *, row_number() over ( 3 | partition by 4 | 5 | 6 | 7 | payload.id 8 | 9 | order by timestamp desc 10 | ) as row_number 11 | from `project.dataset.example_raw` 12 | ) 13 | where row_number = 1 14 | and operation != 'DELETE' 15 | -------------------------------------------------------------------------------- /pkg/sinks/file/file.go: -------------------------------------------------------------------------------- 1 | // Implements a file sink, intended for testing. It's possible people may want to use this 2 | // for JSON dumps of their database, but it may need extending to better suit that 3 | // use-case. 4 | package file 5 | -------------------------------------------------------------------------------- /pkg/sinks/file/inserter.go: -------------------------------------------------------------------------------- 1 | package file 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "fmt" 7 | "os" 8 | "sync" 9 | 10 | "github.com/lawrencejones/pgsink/pkg/changelog" 11 | "github.com/lawrencejones/pgsink/pkg/changelog/serialize" 12 | "github.com/pkg/errors" 13 | ) 14 | 15 | type inserter struct { 16 | file *os.File 17 | serializer serialize.Serializer 18 | sync.Mutex 19 | } 20 | 21 | func (s *inserter) Insert(ctx context.Context, modifications []*changelog.Modification) (count int, lsn *uint64, err error) { 22 | select { 23 | case <-ctx.Done(): 24 | return 0, nil, ctx.Err() 25 | default: 26 | } 27 | 28 | var buffer bytes.Buffer 29 | for _, modification := range modifications { 30 | count++ 31 | if modification.LSN != nil { 32 | if lsn == nil || *lsn < *modification.LSN { 33 | lsn = modification.LSN 34 | } 35 | } 36 | 37 | bytes, err := s.serializer.Marshal(modification) 38 | if err != nil { 39 | return count, lsn, errors.Wrap(err, "failed to marshal modification") 40 | } 41 | 42 | if _, err := fmt.Fprintln(&buffer, string(bytes)); err != nil { 43 | return count, lsn, errors.Wrap(err, "failed to write to buffer") 44 | } 45 | } 46 | 47 | s.Lock() 48 | defer s.Unlock() 49 | 50 | _, err = s.file.Write(buffer.Bytes()) 51 | return count, lsn, errors.Wrap(err, "failed to write modification") 52 | } 53 | -------------------------------------------------------------------------------- /pkg/sinks/generic/README.md: -------------------------------------------------------------------------------- 1 | # Generic Sink utilities 2 | 3 | Sinks should be spoken about in abstract, as managing the flow of data from 4 | the changelog into a sink is complex, and we prefer to create reliable 5 | abstractions once that can be used everywhere. 6 | 7 | With this focus, the `generic` package provides composable sink constructors. 8 | -------------------------------------------------------------------------------- /pkg/sinks/generic/async_inserter_test.go: -------------------------------------------------------------------------------- 1 | package generic_test 2 | 3 | import ( 4 | "github.com/lawrencejones/pgsink/pkg/sinks/generic" 5 | 6 | . "github.com/onsi/ginkgo" 7 | _ "github.com/onsi/ginkgo/extensions/table" 8 | _ "github.com/onsi/gomega" 9 | _ "github.com/onsi/gomega/gstruct" 10 | ) 11 | 12 | var _ = Describe("NewAsyncInserter", func() { 13 | var ( 14 | suite = AsyncInserterSuite{ 15 | New: func(backend fakeBackend) generic.AsyncInserter { 16 | return generic.NewAsyncInserter(backend[0]) 17 | }, 18 | NewBackend: func() fakeBackend { 19 | return newFakeBackend(&fakeInserter{MemoryInserter: generic.NewMemoryInserter()}) 20 | }, 21 | } 22 | ) 23 | 24 | Describe("AsyncInserter interface", func() { 25 | verifyGenericAsyncInserter(suite) 26 | }) 27 | }) 28 | -------------------------------------------------------------------------------- /pkg/sinks/generic/generic.go: -------------------------------------------------------------------------------- 1 | // Suite of components that can be composed to make sinks. By extracting complex, non-sink 2 | // specific behaviour, we minimise the effort involved in implementing a new sink while 3 | // ensuring each sink has consistent semantics. 4 | package generic 5 | -------------------------------------------------------------------------------- /pkg/sinks/generic/inserter_test.go: -------------------------------------------------------------------------------- 1 | package generic_test 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/lawrencejones/pgsink/pkg/changelog" 7 | "github.com/lawrencejones/pgsink/pkg/sinks/generic" 8 | 9 | . "github.com/onsi/ginkgo" 10 | _ "github.com/onsi/ginkgo/extensions/table" 11 | . "github.com/onsi/gomega" 12 | . "github.com/onsi/gomega/gstruct" 13 | ) 14 | 15 | var _ = Describe("MemoryInserter", func() { 16 | var ( 17 | ctx context.Context 18 | inserter *generic.MemoryInserter 19 | cancel func() 20 | ) 21 | 22 | BeforeEach(func() { 23 | ctx, cancel = context.WithCancel(context.Background()) 24 | inserter = generic.NewMemoryInserter() 25 | }) 26 | 27 | AfterEach(func() { 28 | cancel() 29 | }) 30 | 31 | Describe(".Insert", func() { 32 | It("adds successive modifications to the in-memory store", func() { 33 | count, lsn, err := inserter. 34 | Insert(ctx, []*changelog.Modification{fixtureExample1Insert, fixtureExample1UpdateFirst}) 35 | 36 | Expect(count).To(Equal(2)) 37 | Expect(lsn).To(PointTo(BeNumerically("==", 2))) 38 | Expect(err).To(BeNil()) 39 | 40 | count, lsn, err = inserter.Insert(ctx, []*changelog.Modification{fixtureExample1UpdateSecond}) 41 | 42 | Expect(count).To(Equal(1)) 43 | Expect(lsn).To(PointTo(BeNumerically("==", 3))) 44 | Expect(err).To(BeNil()) 45 | 46 | Expect(inserter.Store()).To(ConsistOf( 47 | fixtureExample1Insert, 48 | fixtureExample1UpdateFirst, 49 | fixtureExample1UpdateSecond, 50 | )) 51 | }) 52 | }) 53 | }) 54 | -------------------------------------------------------------------------------- /pkg/sinks/generic/suite_test.go: -------------------------------------------------------------------------------- 1 | package generic_test 2 | 3 | import ( 4 | "testing" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | ) 11 | 12 | var logger = kitlog.NewLogfmtLogger(GinkgoWriter) 13 | 14 | func TestSuite(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "pkg/sinks/generic") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/sinks/generic/testdata/schema.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": "2020-04-20T15:31:28.723201Z", 3 | "lsn": 61055496, 4 | "spec": { 5 | "namespace": "public.example", 6 | "type": "record", 7 | "name": "value", 8 | "fields": [ 9 | { 10 | "name": "id", 11 | "type": [ 12 | "null", 13 | "long" 14 | ], 15 | "default": null 16 | }, 17 | { 18 | "name": "msg", 19 | "type": [ 20 | "null", 21 | "string" 22 | ], 23 | "default": null 24 | } 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pkg/sinks/generic/testdata/schema.example_another.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": "2020-04-20T16:55:47.363412Z", 3 | "lsn": 63670640, 4 | "spec": { 5 | "namespace": "public.example", 6 | "type": "record", 7 | "name": "value", 8 | "fields": [ 9 | { 10 | "name": "id", 11 | "type": [ 12 | "null", 13 | "long" 14 | ], 15 | "default": null 16 | }, 17 | { 18 | "name": "msg", 19 | "type": [ 20 | "null", 21 | "string" 22 | ], 23 | "default": null 24 | }, 25 | { 26 | "name": "another", 27 | "type": [ 28 | "null", 29 | "string" 30 | ], 31 | "default": null 32 | } 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pkg/subscription/marshal.go: -------------------------------------------------------------------------------- 1 | package subscription 2 | 3 | import ( 4 | "github.com/lawrencejones/pgsink/pkg/decode" 5 | "github.com/lawrencejones/pgsink/pkg/logical" 6 | ) 7 | 8 | // MarshalTuple generates a map[string]interface{} from a tuple, using the column type 9 | // information in the relation to find appropriate scanners in the decoder. 10 | // 11 | // This is the function that defines how a logical message is encoded into a changelog 12 | // entry. It's important that it matches the behaviour of the import code, to prevent 13 | // imported rows from being represented differently to those that came via the logical 14 | // stream. 15 | func MarshalTuple(decoder decode.Decoder, relation *logical.Relation, tuple []logical.Element) (map[string]interface{}, error) { 16 | // TODO: Should we be ignoring this? I haven't investigated why this happens, though it 17 | // appears to have little effect on correctness. 18 | if len(relation.Columns) != len(tuple) { 19 | return nil, nil 20 | } 21 | 22 | row := map[string]interface{}{} 23 | for idx, column := range relation.Columns { 24 | scanner, dest, err := decoder.ScannerFor(column.Type) 25 | if err != nil { 26 | return nil, err 27 | } 28 | 29 | if tuple[idx].Type != 'n' { 30 | if err := scanner.Scan(tuple[idx].Value); err != nil { 31 | return nil, err 32 | } 33 | } 34 | 35 | if err := scanner.AssignTo(dest); err != nil { 36 | return nil, err 37 | } 38 | 39 | // Dereference the value we get from our destination, to remove double pointer-ing 40 | row[column.Name] = decode.Unpack(dest) 41 | } 42 | 43 | return row, nil 44 | } 45 | -------------------------------------------------------------------------------- /pkg/subscription/sequence.go: -------------------------------------------------------------------------------- 1 | package subscription 2 | 3 | import "github.com/lawrencejones/pgsink/pkg/logical" 4 | 5 | // SequencedMessage wraps logical messages with the begin message associated with the 6 | // transaction that the message was contained within. 7 | type SequencedMessage struct { 8 | Begin logical.Begin 9 | Sequence uint64 10 | Entry logical.Message // the original message 11 | } 12 | 13 | // Sequence receives a channel containing logical replication messages and produces 14 | // a channel which annotates each message with commit information. Sequenced structs can 15 | // be tracked back to a specific LSN, and logically ordered by sequence number, ensuring 16 | // we can detect the authoriative row value even if the same row is updated many times 17 | // within the same transaction. 18 | // 19 | // This will almost always be used like so: 20 | // 21 | // Sequence(stream.Messages()) 22 | // 23 | // Where stream is an active Stream. 24 | func Sequence(messages <-chan interface{}) <-chan SequencedMessage { 25 | output := make(chan SequencedMessage) 26 | 27 | go func() { 28 | var currentTransaction *logical.Begin 29 | var sequence uint64 30 | 31 | for msg := range messages { 32 | switch msg := msg.(type) { 33 | case *logical.Begin: 34 | currentTransaction = msg 35 | sequence = 0 36 | case *logical.Commit: 37 | currentTransaction = nil 38 | default: 39 | sequence++ 40 | output <- SequencedMessage{ 41 | Begin: *currentTransaction, 42 | Sequence: sequence, 43 | Entry: msg, 44 | } 45 | } 46 | } 47 | 48 | close(output) 49 | }() 50 | 51 | return output 52 | } 53 | -------------------------------------------------------------------------------- /pkg/subscription/suite_test.go: -------------------------------------------------------------------------------- 1 | package subscription_test 2 | 3 | import ( 4 | "testing" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | ) 11 | 12 | var logger = kitlog.NewLogfmtLogger(GinkgoWriter) 13 | 14 | func TestSuite(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "pkg/subscription") 17 | } 18 | -------------------------------------------------------------------------------- /tools.go: -------------------------------------------------------------------------------- 1 | // +build tools 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/go-jet/jet/v2/cmd/jet" 7 | _ "github.com/onsi/ginkgo/ginkgo" 8 | _ "goa.design/goa/v3/cmd/goa" 9 | _ "golang.org/x/tools/cmd/goimports" 10 | ) 11 | -------------------------------------------------------------------------------- /web/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | settings: { 5 | react: { 6 | version: "detect" // Tells eslint-plugin-react to automatically detect the version of React to use 7 | } 8 | }, 9 | plugins: [ 10 | '@typescript-eslint', 11 | ], 12 | extends: [ 13 | 'eslint:recommended', 14 | 'plugin:@typescript-eslint/recommended', 15 | 'prettier', 16 | 'prettier/@typescript-eslint', 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | /node_modules 3 | /.pnp 4 | .pnp.js 5 | 6 | # testing 7 | /coverage 8 | /.eslintcache 9 | 10 | # production 11 | /build 12 | !/build/gitkeep 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /web/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 2, 7 | }; 8 | -------------------------------------------------------------------------------- /web/build.go: -------------------------------------------------------------------------------- 1 | package web 2 | 3 | import ( 4 | "embed" 5 | "io/fs" 6 | "net/http" 7 | "os" 8 | "path" 9 | ) 10 | 11 | //go:embed build/* 12 | var Assets embed.FS 13 | 14 | // Pre-flight check. If we haven't built the assets, or they are missing for some reason, 15 | // then we want to break the build. This prevents accidentally shipping a binary that has 16 | // no website. 17 | // 18 | // Only run this when the GORELEASER environment variable is set, so we only break release 19 | // builds. 20 | func init() { 21 | if os.Getenv("GORELEASER") != "" { 22 | _, err := Assets.Open("build/index.html") 23 | if err != nil { 24 | panic("failed to open build/index.html: have we built assets with 'yarn build'?") 25 | } 26 | } 27 | } 28 | 29 | type fsFunc func(name string) (fs.File, error) 30 | 31 | func (f fsFunc) Open(name string) (fs.File, error) { 32 | return f(name) 33 | } 34 | 35 | // AssetHandler returns an http.Handler that will serve files from the Assets embed.FS. 36 | // When locating a file, it will strip the given prefix from the request and prepend the 37 | // root to the filesystem lookup: typical prefix might be /web/, and root would be build. 38 | func AssetHandler(prefix, root string) http.Handler { 39 | handler := fsFunc(func(name string) (fs.File, error) { 40 | assetPath := path.Join(root, name) 41 | 42 | // If we can't find the asset, return the default index.html content 43 | f, err := Assets.Open(assetPath) 44 | if os.IsNotExist(err) { 45 | return Assets.Open("build/index.html") 46 | } 47 | 48 | // Otherwise assume this is a legitimate request routed correctly 49 | return f, err 50 | }) 51 | 52 | return http.StripPrefix(prefix, http.FileServer(http.FS(handler))) 53 | } 54 | -------------------------------------------------------------------------------- /web/build/gitkeep: -------------------------------------------------------------------------------- 1 | # This file ensures we always create a .gitkeep in the build directory, allowing 2 | # us to include just the .gitkeep file into git. We do this so the build.go can 3 | # embed the build directory even when we haven't yet compiled the production 4 | # assets, aiding local development. 5 | # 6 | # There is a pre-flight check in build.go that breaks the build if the assets 7 | # aren't valid when releasing. 8 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "version": "0.1.0", 4 | "private": true, 5 | "proxy": "http://localhost:8080", 6 | "homepage": "/web", 7 | "dependencies": { 8 | "@testing-library/jest-dom": "^5.11.4", 9 | "@testing-library/react": "^11.1.0", 10 | "@testing-library/user-event": "^12.1.10", 11 | "@types/jest": "^26.0.15", 12 | "@types/lodash": "^4.14.168", 13 | "@types/node": "^12.0.0", 14 | "@types/react": "^16.9.53", 15 | "@types/react-dom": "^16.9.8", 16 | "@types/react-router-dom": "^5.1.7", 17 | "bootstrap": "^5.0.0-beta1", 18 | "bootstrap-icons": "^1.3.0", 19 | "fuse.js": "^6.4.6", 20 | "react": "^17.0.1", 21 | "react-bootstrap-v5": "^1.4.0", 22 | "react-dom": "^17.0.1", 23 | "react-router-dom": "^5.2.0", 24 | "react-scripts": "4.0.2", 25 | "typescript": "^4.1.5", 26 | "web-vitals": "^0.2.4" 27 | }, 28 | "scripts": { 29 | "start": "react-scripts start", 30 | "build": "react-scripts build", 31 | "test": "react-scripts test", 32 | "eject": "react-scripts eject", 33 | "lint": "eslint 'src/**/*.{js,ts,tsx}' --fix", 34 | "pretty": "prettier 'src/**/*.{js,ts,tsx}' --write" 35 | }, 36 | "eslintConfig": { 37 | "extends": [ 38 | "react-app", 39 | "react-app/jest" 40 | ] 41 | }, 42 | "browserslist": { 43 | "production": [ 44 | ">0.2%", 45 | "not dead", 46 | "not op_mini all" 47 | ], 48 | "development": [ 49 | "last 1 chrome version", 50 | "last 1 firefox version", 51 | "last 1 safari version" 52 | ] 53 | }, 54 | "devDependencies": { 55 | "@typescript-eslint/eslint-plugin": "^4.15.0", 56 | "@typescript-eslint/parser": "^4.15.0", 57 | "eslint": "^7.20.0", 58 | "eslint-config-prettier": "^7.2.0", 59 | "eslint-plugin-prettier": "^3.3.1", 60 | "prettier": "^2.2.1" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /web/public/gitkeep: -------------------------------------------------------------------------------- 1 | # This file ensures we always create a .gitkeep in the build directory, allowing 2 | # us to include just the .gitkeep file into git. We do this so the build.go can 3 | # embed the build directory even when we haven't yet compiled the production 4 | # assets, aiding local development. 5 | # 6 | # There is a pre-flight check in build.go that breaks the build if the assets 7 | # aren't valid when releasing. 8 | -------------------------------------------------------------------------------- /web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 11 | 15 | 16 | 25 |