mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.4.1
This commit is contained in:
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
public class DbMaprArg {
|
||||
public String ObjProp() {return objProp;} private String objProp;
|
||||
public String DbFld() {return dbFld;} private String dbFld;
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
public class DbMaprItm {
|
||||
public String TableName() {return tableName;} public DbMaprItm TableName_(String val) {tableName = val; return this;} private String tableName;
|
||||
public Ordered_hash Flds() {return flds;} Ordered_hash flds = Ordered_hash_.New();
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
public class DbMaprMgr {
|
||||
public DbMaprArg[] RootIndexFlds() {return rootIndexFlds;} public DbMaprMgr RootIndexFlds_(DbMaprArg... val) {rootIndexFlds = val; return this;} DbMaprArg[] rootIndexFlds;
|
||||
public DbMaprItm Root() {return root;} public DbMaprMgr Root_(DbMaprItm v) {root = v; return this;} DbMaprItm root;
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
import org.junit.*;
|
||||
import gplx.dbs.*; /*Db_conn_info*/
|
||||
public class DbMaprMgr_tst {
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
import gplx.core.criterias.*; import gplx.dbs.*; import gplx.core.gfo_ndes.*;
|
||||
public class DbMaprRdr extends DataRdr_base implements SrlMgr {
|
||||
@Override public String NameOfNode() {return "DbMaprRdr";}
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
import gplx.core.criterias.*; import gplx.core.gfo_ndes.*;
|
||||
import gplx.dbs.*; import gplx.dbs.qrys.*;
|
||||
public class DbMaprWtr extends DataWtr_base implements DataWtr {
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
import java.sql.Date;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
import java.sql.ResultSet;
|
||||
public class Db_data_rdr_ {
|
||||
public static Db_data_rdr new_(ResultSet rdr, String commandText) {return new Db_data_rdr().ctor_db_data_rdr(rdr, commandText);}
|
||||
@@ -15,7 +15,7 @@ GNU Affero General Public License for more details.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.stores; import gplx.*;
|
||||
package gplx.core.stores; import gplx.*; import gplx.core.*;
|
||||
class MockDisc implements SrlObj, GfoInvkAble {
|
||||
public int Id() {return id;} public MockDisc Id_(int val) {id = val; return this;} int id; public static final String id_idk = "id";
|
||||
public String Name() {return name;} public MockDisc Name_(String val) {name = val; return this;} private String name; public static final String name_idk = "name";
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs; import gplx.*;
|
||||
import gplx.dbs.engines.*; import gplx.dbs.qrys.*;
|
||||
import gplx.dbs.engines.*; import gplx.dbs.qrys.*; import gplx.core.stores.*;
|
||||
public class Db_conn {
|
||||
private final List_adp rls_list = List_adp_.new_(); private final Db_engine engine;
|
||||
public Db_conn(Db_engine engine) {this.engine = engine;}
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs; import gplx.*;
|
||||
import gplx.core.stores.*;
|
||||
import gplx.dbs.qrys.*;
|
||||
public class Db_conn_ {
|
||||
public static final Db_conn Noop = Db_conn_pool.Instance.Get_or_new(Db_conn_info_.Null);
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs; import gplx.*;
|
||||
import org.junit.*; import gplx.core.criterias.*; import gplx.core.gfo_ndes.*;
|
||||
import org.junit.*; import gplx.core.criterias.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*;
|
||||
public class Db_crt_tst {
|
||||
@Before public void setup() {
|
||||
row = GfoNde_.vals_(GfoFldList_.new_().Add("id", IntClassXtn.Instance).Add("name", StringClassXtn.Instance), Object_.Ary(1, "me"));
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs; import gplx.*;
|
||||
import gplx.dbs.engines.*;
|
||||
import gplx.dbs.engines.*; import gplx.core.stores.*;
|
||||
public interface Db_stmt extends RlsAble {
|
||||
Db_stmt Crt_bool_as_byte(String k, boolean v);
|
||||
Db_stmt Val_bool_as_byte(String k, boolean v);
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.stores.*;
|
||||
public interface Db_engine {
|
||||
String Tid();
|
||||
Db_conn_info Conn_info();
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines; import gplx.*; import gplx.dbs.*;
|
||||
import java.sql.*;
|
||||
import gplx.core.stores.*;
|
||||
import gplx.dbs.engines.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*;
|
||||
public abstract class Db_engine_sql_base implements Db_engine {
|
||||
@gplx.Internal protected void Ctor(Db_conn_info conn_info) {this.conn_info = conn_info;}
|
||||
@@ -79,7 +80,7 @@ public abstract class Db_engine_sql_base implements Db_engine {
|
||||
@gplx.Virtual public void Env_db_detach(String alias) {}
|
||||
@gplx.Virtual public boolean Meta_tbl_exists(String tbl) {return false;}
|
||||
@gplx.Virtual public boolean Meta_fld_exists(String tbl, String fld) {return false;}
|
||||
@gplx.Virtual public DataRdr New_rdr(ResultSet rdr, String sql) {return gplx.stores.Db_data_rdr_.new_(rdr, sql);}
|
||||
@gplx.Virtual public DataRdr New_rdr(ResultSet rdr, String sql) {return gplx.core.stores.Db_data_rdr_.new_(rdr, sql);}
|
||||
@gplx.Virtual public Sql_qry_wtr SqlWtr() {return Sql_qry_wtr_.new_ansi();}
|
||||
private Db_rdr New_rdr(Db_stmt stmt, Object rdr, String sql) {
|
||||
Db_rdr__basic rv = (Db_rdr__basic)New_rdr_clone();
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.mems; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.stores.*;
|
||||
public class Db_engine__mem implements Db_engine {
|
||||
private final Hash_adp tbl_hash = Hash_adp_.new_();
|
||||
Db_engine__mem(Db_conn_info conn_info) {this.conn_info = conn_info;}
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.mems; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.stores.*;
|
||||
public class Db_stmt__mem implements Db_stmt {
|
||||
private static final String Key_na = ""; // key is not_available; only called by procs with signature of Val(<type> v);
|
||||
private final Ordered_hash val_list = Ordered_hash_.New();
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.mysql; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.stores.*; import gplx.dbs.engines.*; import gplx.dbs.sqls.*;
|
||||
import gplx.core.stores.*; import gplx.dbs.engines.*; import gplx.dbs.sqls.*;
|
||||
import java.sql.*;
|
||||
public class Mysql_engine extends Db_engine_sql_base {
|
||||
@Override public String Tid() {return Mysql_conn_info.Tid_const;}
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.nulls; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.stores.*;
|
||||
public class Noop_engine implements Db_engine {
|
||||
public String Tid() {return Noop_conn_info.Tid_const;}
|
||||
public Db_conn_info Conn_info() {return Db_conn_info_.Null;}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.postgres; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.stores.*; import gplx.dbs.engines.*; import gplx.dbs.sqls.*;
|
||||
import gplx.core.stores.*; import gplx.dbs.engines.*; import gplx.dbs.sqls.*;
|
||||
import java.sql.*;
|
||||
public class Postgres_engine extends Db_engine_sql_base {
|
||||
@Override public String Tid() {return Postgres_conn_info.Tid_const;}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.sqlite; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import java.sql.*;
|
||||
import gplx.stores.*; import gplx.dbs.engines.*; import gplx.dbs.engines.sqlite.*;
|
||||
import gplx.core.stores.*; import gplx.dbs.engines.*; import gplx.dbs.engines.sqlite.*;
|
||||
import gplx.dbs.qrys.*;
|
||||
public class Sqlite_engine extends Db_engine_sql_base {
|
||||
private final Sqlite_txn_mgr txn_mgr; private final Sqlite_schema_mgr schema_mgr;
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.stores.*;
|
||||
class TdbDbLoadMgr {
|
||||
public TdbDatabase LoadTbls(Io_url dbInfo) {
|
||||
TdbDatabase db = TdbDatabase.new_(dbInfo);
|
||||
|
||||
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import org.junit.*; import gplx.core.gfo_ndes.*;
|
||||
import gplx.stores.*; /*DsvDataRdr*/ import gplx.langs.dsvs.*; /*DsvDataWtr*/
|
||||
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*;
|
||||
import gplx.core.stores.*; /*DsvDataRdr*/ import gplx.langs.dsvs.*; /*DsvDataWtr*/
|
||||
public class TdbDbLoadMgr_tst {
|
||||
@Before public void setup() {
|
||||
Io_url dbInfo = Io_url_.mem_fil_("mem/dir/db0.dsv");
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.stores.*;
|
||||
class TdbDbSaveMgr {
|
||||
public void SaveDb(TdbDatabase db) {
|
||||
for (Object filObj : db.Files()) {
|
||||
|
||||
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import org.junit.*;
|
||||
import gplx.langs.dsvs.*; /*DsvDataWtr*/
|
||||
import org.junit.*; import gplx.core.stores.*;
|
||||
import gplx.langs.dsvs.*; import gplx.core.type_xtns.*;
|
||||
public class TdbDbSaveMgr_tst {
|
||||
@Before public void setup() {
|
||||
Io_url dbInfo = Io_url_.mem_fil_("mem/dir/db0.dsv");
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.criterias.*; import gplx.lists.*; /*GfoNde*/ import gplx.dbs.qrys.*; import gplx.core.gfo_ndes.*;
|
||||
import gplx.core.criterias.*; import gplx.core.lists.*; /*GfoNde*/ import gplx.dbs.qrys.*; import gplx.core.gfo_ndes.*;
|
||||
class TdbDeleteWkr implements Db_qryWkr {
|
||||
public Object Exec(Db_engine engineObj, Db_qry cmdObj) {
|
||||
TdbEngine engine = TdbEngine.cast(engineObj); Db_qry_delete cmd = (Db_qry_delete)cmdObj;
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.stores.*;
|
||||
import gplx.dbs.qrys.*; import gplx.dbs.sqls.*;
|
||||
public class TdbEngine implements Db_engine {
|
||||
public String Tid() {return Tdb_conn_info.Tid_const;}
|
||||
|
||||
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.gfo_ndes.*;
|
||||
import gplx.lists.*; /*Ordered_hash_base*/ import gplx.langs.dsvs.*; /*DsvStoreLayout*/
|
||||
import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; import gplx.core.stores.*;
|
||||
import gplx.core.lists.*; /*Ordered_hash_base*/ import gplx.langs.dsvs.*; /*DsvStoreLayout*/
|
||||
public class TdbFileList extends Ordered_hash_base {
|
||||
public TdbFile Get_by_or_fail(int id) {return TdbFile.as_(Get_by_or_fail_base(id));}
|
||||
public void Add(TdbFile src) {Add_base(src.Id(), src);}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.lists.*; /*GfoNde*/ import gplx.dbs.qrys.*;
|
||||
import gplx.core.lists.*; /*GfoNde*/ import gplx.dbs.qrys.*;
|
||||
class TdbFlushWkr implements Db_qryWkr {
|
||||
public Object Exec(Db_engine engineObj, Db_qry cmdObj) {
|
||||
TdbEngine engine = TdbEngine.cast(engineObj); Db_qry_flush cmd = Db_qry_flush.cast(cmdObj);
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import org.junit.*;
|
||||
import gplx.core.ios.*; /*IoMgrFxt*/ import gplx.dbs.qrys.*;
|
||||
import gplx.core.ios.*; /*IoMgrFxt*/ import gplx.dbs.qrys.*; import gplx.core.type_xtns.*;
|
||||
public class TdbFlush_tst {
|
||||
@Before public void setup() {
|
||||
Io_mgr.Instance.InitEngine_mem();
|
||||
|
||||
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.gfo_ndes.*;
|
||||
import gplx.lists.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*;
|
||||
import gplx.core.gfo_ndes.*; import gplx.core.stores.*;
|
||||
import gplx.core.lists.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*;
|
||||
class TdbInsertWkr implements Db_qryWkr {
|
||||
public Object Exec(Db_engine engineObj, Db_qry cmdObj) {
|
||||
TdbEngine engine = TdbEngine.cast(engineObj); Db_qry_insert cmd = (Db_qry_insert)cmdObj;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.criterias.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*;
|
||||
import gplx.lists.*; /*ComparerAble*/ import gplx.stores.*; /*GfoNdeRdr*/
|
||||
import gplx.core.lists.*; /*ComparerAble*/ import gplx.core.stores.*; /*GfoNdeRdr*/
|
||||
class TdbSelectWkr implements Db_qryWkr {
|
||||
public Object Exec(Db_engine engineObj, Db_qry cmdObj) {
|
||||
TdbEngine engine = TdbEngine.cast(engineObj); Db_qry__select_cmd cmd = (Db_qry__select_cmd)cmdObj;
|
||||
|
||||
@@ -16,10 +16,10 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.stores.*;
|
||||
import gplx.stores.xmls.*; /*XmlDataRdr*/
|
||||
import gplx.core.stores.*;
|
||||
import gplx.core.stores.xmls.*; /*XmlDataRdr*/
|
||||
import gplx.langs.dsvs.*; /*DsvDataWtr*/
|
||||
import gplx.lists.*; /*GfoNdeRdr*/
|
||||
import gplx.core.lists.*; /*GfoNdeRdr*/
|
||||
class TdbStores {
|
||||
public static final String Dsv = "dsv";
|
||||
public static final String Xml = "xml";
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.*; /*GfoNdeList*/ import gplx.stores.*; import gplx.langs.dsvs.*; /*DsvStoreLayout*/ import gplx.core.gfo_ndes.*;
|
||||
import gplx.*; /*GfoNdeList*/ import gplx.core.stores.*; import gplx.langs.dsvs.*; /*DsvStoreLayout*/ import gplx.core.gfo_ndes.*;
|
||||
public class TdbTable {
|
||||
public int Id() {return id;} int id;
|
||||
public String Name() {return name;} private String name;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.lists.*; /*Ordered_hash_base*/ import gplx.langs.dsvs.*; /*DsvStoreLayout*/ import gplx.core.gfo_ndes.*;
|
||||
import gplx.core.lists.*; /*Ordered_hash_base*/ import gplx.langs.dsvs.*; /*DsvStoreLayout*/ import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*; import gplx.core.stores.*;
|
||||
public class TdbTableList extends Ordered_hash_base {
|
||||
public TdbTable Get_by(String name) {return TdbTable.as_(Fetch_base(name));}
|
||||
public TdbTable Get_by_or_fail(String name) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines.tdbs; import gplx.*; import gplx.dbs.*; import gplx.dbs.engines.*;
|
||||
import gplx.core.criterias.*; import gplx.lists.*; /*GfoNde*/ import gplx.core.gfo_ndes.*;
|
||||
import gplx.core.criterias.*; import gplx.core.lists.*; /*GfoNde*/ import gplx.core.gfo_ndes.*;
|
||||
import gplx.dbs.qrys.*;
|
||||
class TdbUpdateWkr implements Db_qryWkr {
|
||||
public Object Exec(Db_engine engineObj, Db_qry cmdObj) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.criterias.*; import gplx.dbs.sqls.*; import gplx.core.gfo_ndes.*;
|
||||
import gplx.core.criterias.*; import gplx.dbs.sqls.*; import gplx.core.gfo_ndes.*; import gplx.core.stores.*;
|
||||
public class Db_qry__select_cmd implements Db_qry {
|
||||
public int Tid() {return Db_qry_.Tid_select;}
|
||||
public boolean Exec_is_rdr() {return true;}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*;
|
||||
import java.sql.*;
|
||||
import gplx.dbs.engines.*; import gplx.dbs.sqls.*;
|
||||
import gplx.dbs.engines.*; import gplx.dbs.sqls.*; import gplx.core.stores.*;
|
||||
public class Db_stmt_cmd implements Db_stmt {
|
||||
private static final String Key_na = ""; // key is not_available; only called by procs with signature of Val(<type> v);
|
||||
private Db_engine engine;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
import gplx.core.brys.fmtrs.*; import gplx.core.stores.*;
|
||||
import gplx.dbs.engines.*;
|
||||
public class Db_stmt_sql implements Db_stmt {// used for formatting SQL statements; not used for actual insert into database
|
||||
private static final String Key_na = ""; // key is not_available; only called by procs with signature of Val(<type> v);
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.sqls; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.gfo_ndes.*;
|
||||
import gplx.lists.*;
|
||||
import gplx.core.lists.*;
|
||||
public class Sql_order_by_sorter implements ComparerAble {
|
||||
public int compare(Object lhsObj, Object rhsObj) {
|
||||
GfoNde lhs = (GfoNde)lhsObj; GfoNde rhs = (GfoNde)rhsObj;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.sqls; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.gfo_ndes.*;
|
||||
import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*;
|
||||
public class Sql_select_fld_ {
|
||||
public static Sql_select_fld_base new_fld(String tbl, String fld, String alias) {return new Sql_select_fld_fld(tbl, fld, alias);}
|
||||
public static Sql_select_fld_base new_count(String tbl, String fld, String alias) {return new Sql_select_fld_count(tbl, fld, alias);}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.sqls; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.gfo_ndes.*;
|
||||
import gplx.core.gfo_ndes.*; import gplx.core.type_xtns.*;
|
||||
public abstract class Sql_select_fld_base {
|
||||
public String Tbl() {return tbl;} public void Tbl_set(String val) {tbl = val;} private String tbl;
|
||||
public String Fld() {return fld;} public void Fld_set(String val) {fld = val;} private String fld;
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.utls; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.envs.*;
|
||||
public class Db_cmd_backup implements GfoInvkAble {
|
||||
public String DbName() {return dbName;} public Db_cmd_backup DbName_(String val) {dbName = val; return this;} private String dbName = "db";
|
||||
public Io_url ExeUrl() {return exeUrl;} public Db_cmd_backup ExeUrl_(Io_url val) {exeUrl = val; return this;} Io_url exeUrl;
|
||||
@@ -51,7 +52,7 @@ public class Db_cmd_backup implements GfoInvkAble {
|
||||
Io_url bkpCmdFil = bkpDir.GenSubFil_ary("backup_", dbName, ".cmd");
|
||||
// Io_url bkpCmdFil = Io_url_.new_dir_("/home/").GenSubFil_ary("backup_", dbName, ".cmd"); // LNX: uncomment
|
||||
Io_mgr.Instance.SaveFilStr_args(bkpCmdFil, cmdText).Exec(); // explicitly state utf8;
|
||||
ProcessAdp.run_wait_(bkpCmdFil);
|
||||
Process_adp.run_wait_(bkpCmdFil);
|
||||
Io_mgr.Instance.DeleteFil(bkpCmdFil);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.utls; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.stores.*;
|
||||
import gplx.dbs.qrys.*;
|
||||
public class PoolIds {
|
||||
public int FetchNext(Db_conn conn, String url) {
|
||||
|
||||
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs; import gplx.*;
|
||||
import gplx.core.stores.*;
|
||||
import gplx.dbs.engines.sqlite.*; import gplx.dbs.engines.mysql.*; import gplx.dbs.engines.postgres.*; import gplx.core.gfo_ndes.*;
|
||||
public class Db_conn_fxt implements RlsAble {
|
||||
public Db_conn Conn() {return conn;} public Db_conn_fxt Conn_(Db_conn v) {conn = v; return this;} Db_conn conn;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.engines; import gplx.*; import gplx.dbs.*;
|
||||
import org.junit.*;
|
||||
import org.junit.*; import gplx.core.type_xtns.*; import gplx.core.stores.*;
|
||||
public class db_DataTypes_tst {
|
||||
DataTypes_base_fxt fx = new DataTypes_base_fxt();
|
||||
@Test public void Mysql() {if (Tfds.SkipDb) return;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.groupBys; import gplx.*; import gplx.dbs.*;
|
||||
import org.junit.*; import gplx.dbs.qrys.*; import gplx.core.gfo_ndes.*;
|
||||
import org.junit.*; import gplx.dbs.qrys.*; import gplx.core.gfo_ndes.*; import gplx.core.stores.*;
|
||||
public abstract class GroupBys_base_tst {
|
||||
protected abstract Db_conn provider_();
|
||||
protected Db_conn conn;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.insertIntos; import gplx.*; import gplx.dbs.*;
|
||||
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*;
|
||||
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*; import gplx.core.stores.*;
|
||||
public abstract class InsertIntos_base_tst {
|
||||
protected abstract Db_conn provider_();
|
||||
protected Db_conn conn;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.joins; import gplx.*; import gplx.dbs.*;
|
||||
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*;
|
||||
import org.junit.*; import gplx.core.gfo_ndes.*; import gplx.dbs.qrys.*; import gplx.dbs.sqls.*; import gplx.core.stores.*;
|
||||
public abstract class Joins_base_tst {
|
||||
protected Db_conn conn;
|
||||
@Before public void setup() {
|
||||
|
||||
@@ -16,7 +16,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs;
|
||||
import gplx.*; import gplx.core.consoles.*; import gplx.dbs.engines.sqlite.*;
|
||||
import gplx.*; import gplx.core.consoles.*; import gplx.core.envs.Env_;
|
||||
import gplx.dbs.engines.sqlite.*;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
Reference in New Issue
Block a user