Skip to content

Commit aac33f1

Browse files
committed
convert mysql table name into suitable function name
1 parent 2fd05aa commit aac33f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mysql-import.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# ---
88

99
import base64
10+
import re
1011
import mysql.connector
1112
from mysql.connector import FieldType
1213
from datetime import *
@@ -84,8 +85,11 @@ def get_function_info(connection, table):
8485
cursor.close()
8586

8687
# return the function info
88+
clean_name = table.lower()
89+
clean_name = 'mysql-' + re.sub('[^0-9a-zA-Z]+', '-', clean_name)
90+
8791
info = {}
88-
info['name'] = 'mysql-' + table.lower() # TODO: make clean name
92+
info['name'] = clean_name
8993
info['title'] = ''
9094
info['description'] = ''
9195
info['task'] = {

0 commit comments

Comments
 (0)