I hereby claim:
- I am martinyung on github.
- I am m4rt1nk (https://keybase.io/m4rt1nk) on keybase.
- I have a public key ASCLKU6hw67b1T8swA9xcKSZerz1Ynk86lH1xT2TftchrAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| def main(): | |
| print('starting etl') | |
| # establish connection for target database (sql-server) | |
| target_cnx = pyodbc.connect(**datawarehouse_db_config) | |
| # loop through credentials | |
| # mysql | |
| for config in mysql_db_config: |
| # example queries, will be different across different db platform | |
| firebird_extract = (''' | |
| SELECT fbd_column_1, fbd_column_2, fbd_column_3 | |
| FROM fbd_table; | |
| ''') | |
| firebird_insert = (''' | |
| INSERT INTO table (column_1, column_2, column_3) | |
| VALUES (?, ?, ?) | |
| ''') |
| def etl(query, source_cnx, target_cnx): | |
| # extract data from source db | |
| source_cursor = source_cnx.cursor() | |
| source_cursor.execute(query.extract_query) | |
| data = source_cursor.fetchall() | |
| source_cursor.close() | |
| # load data into warehouse db | |
| if data: | |
| target_cursor = target_cnx.cursor() |
| from variables import datawarehouse_name | |
| # sql-server (target db, datawarehouse) | |
| datawarehouse_db_config = { | |
| 'Trusted_Connection': 'yes', | |
| 'driver': '{SQL Server}', | |
| 'server': 'datawarehouse_sql_server', | |
| 'database': '{}'.format(datawarehouse_name), | |
| 'user': 'your_db_username', | |
| 'password': 'your_db_password', |
| package [Your_Project] | |
| class UploadController { | |
| def amazonS3Service | |
| def s3Bucket = 'Your_S3_Bucket_Name' | |
| def index() { | |
| def uploadedFile = request.getFile('file') |
| <script> | |
| const BASE_URL = "[YOUR_PROJECT_URL]" | |
| export default { | |
| name: 'FileUpload', | |
| directives: { | |
| uploader: { | |
| bind (el, binding, vnode) { | |
| el.addEventListener('change', e => { |
| <!-- HTML Template --> | |
| <template> | |
| <div> | |
| <div class="input-group"> | |
| <input type="text" class="form-control" placeholder="Select file..." :value="file.name" readonly> | |
| <span class="input-group-btn"> | |
| <button class="btn btn-default" type="button" @click="selectFile">Select file</button> | |
| <button class="btn btn-default" type="button" @click="uploadFile">Upload</button> | |
| </span> | |
| </div> |
| class Hello extends Component { | |
| ... | |
| render() { | |
| return ( | |
| <div> | |
| <h2>Conversational Form</h2> | |
| <div id="cf-context" > {/* <-- the cf form will be bound to this element */} | |
| <form id="form" className="form" ref="form"> | |
| <input type="text" ref="name" placeholder="Name" defaultValue={this.props.name}/> |
| class Hello extends Component { | |
| ... | |
| componentDidMount(){ | |
| // customize your questions here | |
| this.refs.name.setAttribute('cf-questions', "What is your name?"); | |
| this.refs.email.setAttribute('cf-questions', "What is your email?"); | |
| this.refs.description.setAttribute('cf-questions', "Describe your requirement"); | |
| this.cf = window.cf.ConversationalForm.startTheConversation({ |