def get_dialect_name(conn_string):
    """Get the dbms from the connection string.

    example:
    when connection string = 'oracle://scott:tiger@127.0.0.1:1521/sidname'
    it returns 'oracle'.
    """
    dialect = str(conn_string).split(':')[0]
    if '+' in dialect:
        dialect = dialect.split('+')[0]
    dialect = dialect.replace('postgresql', 'postgres')
    return dialect
