Exemple #1
0
 def setup_method(self, method):
     self.tempdir = tempfile.mkdtemp()
     self.md      = mod.GristleMetaData(self.tempdir)
     create_basic_metadata(self.md)
Exemple #2
0
 def setUp(self):
     self.tempdir = tempfile.mkdtemp()
     self.md = mod.GristleMetaData(self.tempdir)
     create_basic_metadata(self.md)
Exemple #3
0
 def setup_method(self, method):
     self.tempdir = tempfile.mkdtemp()
     self.md      = mod.GristleMetaData(self.tempdir)
     self.schema_id, self.collection_id = create_basic_metadata(self.md)
import gristle.metadata as md
###from sqlite3 import dbapi2 as sqlite3
from sqlalchemy import (UniqueConstraint, ForeignKeyConstraint,
                        CheckConstraint)

from sqlalchemy import exc
from sqlalchemy import text

#----- get metadata database ----
import appdirs
#user_data_dir = appdirs.user_data_dir('datagristle')
#if not os.path.exists(user_data_dir):
#    print 'data dir (%s) missing - it will be created' % user_data_dir
#    os.makedirs(user_data_dir)

meta = md.GristleMetaData()
app = Flask(__name__)

#==============================================================================
# Schema Handling
#==============================================================================


@app.route('/', methods=['GET'])
def datagristle():
    connection = meta.engine.connect()
    raw_sql = """SELECT s.schema_name,
                         s.schema_id,
                         s.schema_desc,
                         COALESCE(COUNT(c.schema_id), 0) as coll_cnt
                  FROM schema s