Exemplo n.º 1
0
    def test_connection(self):
        """Connects to database and checks if schema "orig_vg250" exists"""

        db_io.CONFIG_FILENAME = '../db_io_config.ini'
        conn = db_io.db_session()
        result = conn.execute("SELECT "
                              "COUNT(*) AS schema_exists "
                              "FROM information_schema.schemata "
                              "WHERE schema_name = 'orig_vg250'")
        self.assertEqual(next(result), (1, ))
Exemplo n.º 2
0
__version__ = "v0.0.1"

import os
import re
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from geoalchemy2 import Geometry
import shapefile
from db_io import db_session
from db_logger import LogClass
import sqlalchemy
from sqlalchemy import Table, Column, Integer
# from db_store import

# db connecion
con = db_session()
insp = sqlalchemy.inspect(con)
metadata = sqlalchemy.MetaData()
log = LogClass()
Base = declarative_base()

DEFAULT_SCHEMA = 'orig_vg250'
DEFAULT_TABLE = 'importtest'

# set download folder
download_folder = r'C:\eGoPP\vg250'
testpfad = (r'C:\eGoPP\vg250\vg250_2016-01-01.gk3.shape.ebenen\
    vg250_2016-01-01.gk3.shape.ebenen\vg250_ebenen\VG250_GEM')

# ORM
'''