<commit_before>from sqlalchemy.schema import *
import sqlalchemy.engine
import os

engine = sqlalchemy.engine.create_engine('sqlite', ':memory:', {}, echo = True)
#engine = sqlalchemy.engine.create_engine('postgres', {'database':'test', 'host':'127.0.0.1', 'user':'scott', 'password':'<PASSWORD>'}, echo=True)
#engine = sqlalchemy.engine.create_engine('oracle', {'dsn':os.environ['DSN'], 'user':os.environ['USER'], 'password':os.environ['PASSWORD']}, echo=True)


"""create the treenodes table.  This is ia basic adjacency list model table.
One additional column, "root_node_id", references a "root node" row and is used
in the 'byroot_tree' example."""

trees = Table('treenodes', engine,
    Column('node_id', Integer, Sequence('treenode_id_seq',optional=False), primary_key=True),
    Column('parent_node_id', Integer, ForeignKey('treenodes.node_id'), nullable=True),
    Column('root_node_id', Integer, ForeignKey('treenodes.node_id'), nullable=True),
    Column('node_name', String(50), nullable=False),
    Column('data_ident', Integer, ForeignKey('treedata.data_id'))
    )

treedata = Table(
    "treedata", engine, 
    Column('data_id', Integer, primary_key=True),
    Column('value', String(100), nullable=False)
)
    
print "\n\n\n----------------------------"
print "Creating Tree Table:"
print "----------------------------"

treedata.create()    
trees.create()

<commit_msg>new calling style for sqlite engine<commit_after>from sqlalchemy.schema import *
import sqlalchemy.engine
import os

engine = sqlalchemy.engine.create_engine('sqlite', {'filename':':memory:'}, echo = True)
#engine = sqlalchemy.engine.create_engine('postgres', {'database':'test', 'host':'127.0.0.1', 'user':'scott', 'password':'<PASSWORD>'}, echo=True)
#engine = sqlalchemy.engine.create_engine('oracle', {'dsn':os.environ['DSN'], 'user':os.environ['USER'], 'password':os.environ['PASSWORD']}, echo=True)


"""create the treenodes table.  This is ia basic adjacency list model table.
One additional column, "root_node_id", references a "root node" row and is used
in the 'byroot_tree' example."""

trees = Table('treenodes', engine,
    Column('node_id', Integer, Sequence('treenode_id_seq',optional=False), primary_key=True),
    Column('parent_node_id', Integer, ForeignKey('treenodes.node_id'), nullable=True),
    Column('root_node_id', Integer, ForeignKey('treenodes.node_id'), nullable=True),
    Column('node_name', String(50), nullable=False),
    Column('data_ident', Integer, ForeignKey('treedata.data_id'))
    )

treedata = Table(
    "treedata", engine, 
    Column('data_id', Integer, primary_key=True),
    Column('value', String(100), nullable=False)
)
    
print "\n\n\n----------------------------"
print "Creating Tree Table:"
print "----------------------------"

treedata.create()    
trees.create()


{'fraction_non_alphanumeric': 0.20476359758265197, 'fraction_numerical': 0.007820831852115179, 'mean_word_length': 4.826086956521739, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1534273', 'n_tokens_mistral': 928, 'n_tokens_neox': 884, 'n_words': 191}