Skip to content

Commit e9c46a7

Browse files
committed
strike unnecessary gri_refseq_ddl
1 parent 9fdafa1 commit e9c46a7

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ jobs:
4343
- uses: actions/upload-artifact@v2
4444
with:
4545
name: GenomicSQLite-Linux-x86_64-so-${{ env.GIT_REVISION }}
46-
path: build/libgenomicsqlite.so
46+
path: |
47+
build/libgenomicsqlite.so
48+
include/genomicsqlite.h
4749
4850
lint:
4951
runs-on: ubuntu-20.04

bindings/python/genomicsqlite.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def _execute1(conn, sql, params=None):
2323
"""
2424
conn.execute(sql,params) and return row 1 column 1
2525
"""
26+
assert isinstance(conn, sqlite3.Connection)
2627
return next(conn.execute(sql, params) if params else conn.execute(sql))[0]
2728

2829

@@ -182,7 +183,14 @@ def _cli():
182183
file=sys.stderr,
183184
)
184185
sys.exit(1)
185-
uri = _execute1(_MEMCONN, "SELECT genomicsqlite_uri(?)", (sys.argv[1],))
186+
187+
dbfilename = sys.argv[1]
188+
if os.path.islink(dbfilename):
189+
target = os.path.realpath(dbfilename)
190+
print(f"[warning] following symlink {dbfilename} -> {target}")
191+
dbfilename = target
192+
193+
uri = _execute1(_MEMCONN, "SELECT genomicsqlite_uri(?)", (dbfilename,))
186194
tuning_sql = _execute1(_MEMCONN, "SELECT genomicsqlite_tuning_sql()")
187195

188196
if "-readonly" in sys.argv:

src/genomicsqlite.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ string CreateGenomicRangeIndexSQL(const string &schema_table, const string &rid,
485485
}
486486
size_t p;
487487
ostringstream out;
488-
out << gri_refseq_ddl(schema);
489-
out << ";\nALTER TABLE " << schema_table << " ADD COLUMN _gri_rid INTEGER AS (" << rid
488+
out << "ALTER TABLE " << schema_table << " ADD COLUMN _gri_rid INTEGER AS (" << rid
490489
<< ") VIRTUAL";
491490
out << ";\nALTER TABLE " << schema_table << " ADD COLUMN _gri_beg INTEGER AS (" << beg
492491
<< ") VIRTUAL";

0 commit comments

Comments
 (0)