Skip to content

Instantly share code, notes, and snippets.

from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.dialects.mysql import DATE
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
class Customer(Base):
__tablename__ = "customer"
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(50), nullable=False)
# CREATE USER 'example'@'localhost' IDENTIFIED BY 'example_password';
# GRANT ALL PRIVILEGES ON *.* TO 'example'@'localhost' IDENTIFIED BY 'example_password';
# CREATE DATABASE example;
import sys
import os
import time
from datetime import date, timedelta
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.dialects.mysql import DATETIME, DATE
#!/bin/bash
if [ "$#" -ne 5 ]; then
echo "Need the following arguments: filename, table_name, db_name, username, password"
exit 1
fi
csv_filename=$1
table_name=$2
db_name=$3