diff --git a/product/ERP5Catalog/sql/common_mysql/z_catalog_paths.zsql b/product/ERP5Catalog/sql/common_mysql/z_catalog_paths.zsql new file mode 100755 index 0000000000000000000000000000000000000000..7fb9714d43d09fef29b930aab233b23529c83946 --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_catalog_paths.zsql @@ -0,0 +1,11 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:100000 +max_cache:0 +cache_time:0 +class_name: +class_file: +</dtml-comment> +<params></params> +select distinct path from catalog \ No newline at end of file diff --git a/product/ERP5Catalog/sql/common_mysql/z_clear_reserved.zsql b/product/ERP5Catalog/sql/common_mysql/z_clear_reserved.zsql new file mode 100755 index 0000000000000000000000000000000000000000..f4eaf2b02234621f607d78f2a7b34d94675e66d3 --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_clear_reserved.zsql @@ -0,0 +1,14 @@ +<dtml-comment> +title:Clear Reserved Uids +connection_id:erp5_sql_connection +max_rows:1 +max_cache:0 +cache_time:0 +</dtml-comment> +<params>count:int +thread_id +date</params> +DELETE FROM + catalog +WHERE + path = "reserved" diff --git a/product/ERP5Catalog/sql/common_mysql/z_getitem_by_path.zsql b/product/ERP5Catalog/sql/common_mysql/z_getitem_by_path.zsql new file mode 100755 index 0000000000000000000000000000000000000000..c2499948e089dec6ffe52200052214fe64fb8f4a --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_getitem_by_path.zsql @@ -0,0 +1,11 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:10 +max_cache:100 +cache_time:0 +class_name:ZSQLBrain +class_file:zsqlbrain.py +</dtml-comment> +<params>path</params> +select * from catalog where <dtml-sqltest path op=eq type="string"> \ No newline at end of file diff --git a/product/ERP5Catalog/sql/common_mysql/z_getitem_by_uid.zsql b/product/ERP5Catalog/sql/common_mysql/z_getitem_by_uid.zsql new file mode 100755 index 0000000000000000000000000000000000000000..da3771f09c695b533ce8be517a77c9585c7b3f4d --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_getitem_by_uid.zsql @@ -0,0 +1,11 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:1 +max_cache:0 +cache_time:0 +class_name:ZSQLBrain +class_file:zsqlbrain.py +</dtml-comment> +<params>uid</params> +select * from catalog where <dtml-sqltest uid op=eq type="int"> \ No newline at end of file diff --git a/product/ERP5Catalog/sql/common_mysql/z_produce_reserved_uid_list.zsql b/product/ERP5Catalog/sql/common_mysql/z_produce_reserved_uid_list.zsql new file mode 100755 index 0000000000000000000000000000000000000000..be5384721aca3279ca48078fbbf6bc4bb4140129 --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_produce_reserved_uid_list.zsql @@ -0,0 +1,30 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:10000 +max_cache:0 +cache_time:0 +</dtml-comment> +<params>count:int +thread_id +date</params> +INSERT INTO + catalog (id, path, CreationDate) +VALUES +<dtml-in "_.range(0,count)"> +( <dtml-sqlvar thread_id type="string"> , 'reserved', <dtml-sqlvar date type="string"> ) , +</dtml-in> +( <dtml-sqlvar thread_id type="string"> , 'reserved', <dtml-sqlvar date type="string"> ); + +<dtml-var "'\0'"> + +SELECT + uid +FROM + catalog +WHERE + path = 'reserved' +AND + id = <dtml-sqlvar thread_id type="string"> +AND + CreationDate = <dtml-sqlvar date type="string"> \ No newline at end of file diff --git a/product/ERP5Catalog/sql/common_mysql/z_show_columns.zsql b/product/ERP5Catalog/sql/common_mysql/z_show_columns.zsql new file mode 100755 index 0000000000000000000000000000000000000000..ce97b745c85c6c3ec5563bf0bad66e00bddd6ede --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_show_columns.zsql @@ -0,0 +1,11 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:1000 +max_cache:100 +cache_time:0 +class_name: +class_file: +</dtml-comment> +<params>table</params> +show columns from <dtml-var table> \ No newline at end of file diff --git a/product/ERP5Catalog/sql/common_mysql/z_show_tables.zsql b/product/ERP5Catalog/sql/common_mysql/z_show_tables.zsql new file mode 100755 index 0000000000000000000000000000000000000000..e5e021ca3accead8f50e5d2492e734e1a74ec33c --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_show_tables.zsql @@ -0,0 +1,11 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:1000 +max_cache:100 +cache_time:0 +class_name: +class_file: +</dtml-comment> +<params>table</params> +show tables diff --git a/product/ERP5Catalog/sql/common_mysql/z_unique_values.zsql b/product/ERP5Catalog/sql/common_mysql/z_unique_values.zsql new file mode 100755 index 0000000000000000000000000000000000000000..d9dea087f5be85c4ebacd88b6932e63c989ac621 --- /dev/null +++ b/product/ERP5Catalog/sql/common_mysql/z_unique_values.zsql @@ -0,0 +1,11 @@ +<dtml-comment> +title: +connection_id:erp5_sql_connection +max_rows:1000 +max_cache:100 +cache_time:0 +class_name: +class_file: +</dtml-comment> +<params>column</params> +SELECT DISTINCT <dtml-var column> FROM catalog \ No newline at end of file