1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2016-01-17 23:18:07 -05:00
parent 096045614c
commit 235228976e
314 changed files with 4458 additions and 2694 deletions

View File

@@ -32,5 +32,11 @@ public class Db_conn_bldr {
Db_conn rv = wkr.Get(url);
return rv == null ? Db_conn_.Noop : rv;
}
public Db_conn Get_or_autocreate(boolean autocreate, Io_url url) {
boolean exists = wkr.Exists(url);
if (exists) return Get(url);
if (autocreate) return New(url);
else throw Err_.new_("dbs", "db does not exist", "url", url.Raw());
}
public static final Db_conn_bldr Instance = new Db_conn_bldr(); Db_conn_bldr() {}
}