[pgsqlclient-checkins] pgsqlclient_10/PostgreSql.Data.PgSqlClient/source PgCommandBuilder.cs,1.7,1.8
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-09-29 14:37:31
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv19231 Modified Files: PgCommandBuilder.cs Log Message: Some improvements to command builder Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PgCommandBuilder.cs 28 Sep 2003 18:56:54 -0000 1.7 --- PgCommandBuilder.cs 29 Sep 2003 14:37:14 -0000 1.8 *************** *** 125,129 **** sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! whereClausule1 = "(({0} IS NULL AND ${1} IS NULL) OR ({0} = ${2}))"; whereClausule2 = "({0} = ${1})"; setClausule = "{0} = ${1}"; --- 125,129 ---- sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; whereClausule2 = "({0} = ${1})"; setClausule = "{0} = ${1}"; *************** *** 346,350 **** insertCommand = new PgCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); ! int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { --- 346,350 ---- insertCommand = new PgCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); ! int i = 1; foreach (DataRow schemaRow in schemaTable.Rows) { *************** *** 406,410 **** updateCommand = new PgCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); ! int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { --- 406,410 ---- updateCommand = new PgCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); ! int i = 1; foreach (DataRow schemaRow in schemaTable.Rows) { *************** *** 513,517 **** // Build where clausule ! int i = 0; foreach (DataRow schemaRow in schemaTable.Rows) { --- 513,517 ---- // Build where clausule ! int i = 1; foreach (DataRow schemaRow in schemaTable.Rows) { *************** *** 601,605 **** private PgParameter createParameter(DataRow schemaRow, int index, bool isWhereParameter) { ! PgParameter parameter = new PgParameter(String.Format("@param_{0}", index), (PgDbType)schemaRow["ProviderType"]); parameter.Size = Convert.ToInt32(schemaRow["ColumnSize"]); --- 601,605 ---- private PgParameter createParameter(DataRow schemaRow, int index, bool isWhereParameter) { ! PgParameter parameter = new PgParameter(String.Format("@p{0}", index), (PgDbType)schemaRow["ProviderType"]); parameter.Size = Convert.ToInt32(schemaRow["ColumnSize"]); *************** *** 674,681 **** if (!(bool)schemaRow["IsKey"]) { return false; } ! if ((bool)schemaRow["IsLong"]) { return false; --- 674,688 ---- if (!(bool)schemaRow["IsKey"]) { + // return false; + } + + PgDbType pgDbType= (PgDbType)schemaRow["ProviderType"]; + + if (pgDbType == PgDbType.Binary) + { return false; } ! if (pgDbType == PgDbType.Array) { return false; *************** *** 776,780 **** if (e.Command == null) { ! e.Command = buildInsertCommand(e.Row, e.TableMapping); } e.Status = UpdateStatus.Continue; --- 783,788 ---- if (e.Command == null) { ! insertCommand = buildInsertCommand(e.Row, e.TableMapping); ! e.Command = insertCommand; } e.Status = UpdateStatus.Continue; *************** *** 784,788 **** if (e.Command == null) { ! e.Command = buildUpdateCommand(e.Row, e.TableMapping); } e.Status = UpdateStatus.Continue; --- 792,797 ---- if (e.Command == null) { ! updateCommand = buildUpdateCommand(e.Row, e.TableMapping); ! e.Command = updateCommand; } e.Status = UpdateStatus.Continue; *************** *** 792,796 **** if (e.Command == null) { ! e.Command = buildDeleteCommand(e.Row, e.TableMapping); } e.Status = UpdateStatus.Continue; --- 801,806 ---- if (e.Command == null) { ! deleteCommand = buildDeleteCommand(e.Row, e.TableMapping); ! e.Command = deleteCommand; } e.Status = UpdateStatus.Continue; |