dblinq / dblinq2007 Goto Github PK
View Code? Open in Web Editor NEWLINQ provider for Oracle, PostgreSQL, MySQL, Ingres, SQLite, Firebird and ... SQL Server
License: Other
LINQ provider for Oracle, PostgreSQL, MySQL, Ingres, SQLite, Firebird and ... SQL Server
License: Other
Run the Sqlite example.
Patch is attached.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2008 at 1:42
Attachments:
1. See if all extra types are really needed (I hope not)
2. Remove them.
Original issue reported on code.google.com by picrap
on 10 Mar 2008 at 8:18
To reproduce:
1. Run sqlmetal against nortwind database:
SQLMetal.exe -Provider=PostgreSql -forceUcaseID=false -
forceUcaseFieldName -forceUcaseTableName -verboseForeignKeys -
user:postgres -database:northwind -server:localhost -password:xxxxx
2. Look into northwind.cs file.
Expected output:
Only first character in property and table names should be capitalized.
Observed:
1. English language word list is used for captialization. It it not
possible to turn this off.
2. Some characters in some names are randomly capitalized:
[Column(Storage = "hiredAte", ...
HiredAte
QuantityPeruNit
UnitsInsToCK
[Association(Storage = "fKTeRrRegion",
fKProdCatG
Original issue reported on code.google.com by [email protected]
on 18 Mar 2008 at 7:13
I have a db with a table called font and fonts.
Metal will generatet two classes called Font and two tables called Fonts,
which naturally doesn't compile.
This isn't a big deal for me since I can easily drop one of the tables.
Original issue reported on code.google.com by [email protected]
on 13 Jun 2007 at 7:07
Create a new sqlite3 database
run the create_northwind.sql script in that database.
Patch is attached as well as the complete file.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2008 at 1:45
Attachments:
Please check this page http://msdn2.microsoft.com/en-
us/library/4e5xt97a.aspx to to the OraTypeMap correctly.
NUMBER is not a int is a decimal.
if you do that, the UnknownOracleType_20 will not be necessary...
Original issue reported on code.google.com by [email protected]
on 15 Jan 2008 at 6:12
In the class VendorPgsql there is a function ProcessPkField which is
responsible for generating the statement which gets the current value of
the sequence which belongs to the primary key column of the table. This
function only works if you name your sequences the default way.
Isn't there a way to get the name of the sequence from the column
properties DEFAULT nextval('SEQColumnID')? This works always, instead of
only when you use the default sequence name.
Original issue reported on code.google.com by [email protected]
on 30 Jan 2008 at 3:21
What steps will reproduce the problem?
Running Test_NUnit.Linq_101_Samples.LinqToSqlObjectIdentity01()
sometimes give unpredictable results.
The SELECT string isn't always built in the same order. Sometimes
CustomerID and ContactName has changed places witch results in Failure in
the test because CompanyID now has the value "Bon Boss" and
ContactName="BONAP"
This doesn't hapen always but usually the first time i run the tests and if
I run again repeatedly it happens almost 1 on 10 runs.
What is the expected output? What do you see instead?
Test_NUnit.Linq_101_Samples.Object_Identity.LinqToSqlObjectIdentity01 :
CustomerID must be BONAP - was: Bon Boss
Please use labels and text to provide additional information.
This is using SQLite don't know about the others.
Original issue reported on code.google.com by [email protected]
on 18 Jan 2008 at 3:16
MySqlMetal should convert names with underscores to PascalCase
eg [Table(Name="account_login")] should produce AccountLogin instead of
Account_login
Original issue reported on code.google.com by [email protected]
on 13 Jun 2007 at 6:46
If one tries to run the Sqlite example it will throw an error because a
SQLITE compiler condition in RowEnumerator.cs is spelled SQLLITE.
A Patch is attached.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2008 at 1:39
Attachments:
MySQLMetal should have a command-switch for deactivation the Pluralize and
Singularize Methods to prevent wrong renamings for languages different
than english.
Original issue reported on code.google.com by [email protected]
on 7 Jan 2008 at 6:21
When creating a class of a database, which contains the PostgreSQL
function 'plpgsql_call_handler', this function appears in the generated
file.
Because this is function for internal PostgreSQL use only, it should be
ignored when generating the file. This can be accomplished by chancing
the SQL command for retrieving the functions in the file Pg_Proc_Sql.cs
in the function public List<Pg_Proc> getProcs(IDbConnection conn, string
db). The following should be added to the SQL command: " AND pr.proname
<> 'plpgsql_call_handler'".
Maybe there is a better way of filtering out this function, but I'm not
aware of one.
Original issue reported on code.google.com by [email protected]
on 4 Mar 2008 at 12:44
It's all in the title :)
Original issue reported on code.google.com by [email protected]
on 23 Feb 2008 at 9:30
The generated property for a column named "value0" is "value0", causing
conflict with the backing field name.
Original issue reported on code.google.com by picrap
on 16 Mar 2008 at 8:12
The type "timestamp with timzone" is not supported. Should be inserted in
the mappings.cs file just below the type "timestamp without time zone".
Original issue reported on code.google.com by [email protected]
on 4 Mar 2008 at 12:01
Regarding Microsoft DBML, this should not be the case:
- nullable types are always stored as non nullable in "Type" column
- There are no C# optimizations there (because DBML is not C# related)
Original issue reported on code.google.com by picrap
on 16 Mar 2008 at 2:03
MySqlMetal needs support for enumerations
Original issue reported on code.google.com by [email protected]
on 13 Jun 2007 at 6:44
Can't compile DbLinq.Mysql.Prototype. Missing references that were in
System.Data.DLinq but not in System.Data.Linq.
Can't find reference for :
AssociationAttribute, ColumnAttribute, TableAttribute
Original issue reported on code.google.com by [email protected]
on 9 Aug 2007 at 7:02
What steps will reproduce the problem?
1. Connecting to oracle database
2.
3.
What is the expected output? What do you see instead?
Error
What version of the product are you using? On what operating system?
0.15
Please provide any additional information below.
Right syntax to write to open the Oracle connection in the OracleVendor.cs
(Oracle Metal Project) is :
public DlinqSchema.Database LoadSchema()
{
string connStr = string.Format("server={0};user id={1};
password={2}; Data Source={3}"
, mmConfig.server, mmConfig.user, mmConfig.password,
mmConfig.database);
(...)
instead of
public DlinqSchema.Database LoadSchema()
{
//string connStr = string.Format("server={0};user id={1};
password={2}; database={3}; pooling=false"
string connStr = string.Format("server={0};user id={1};
password={2}"
, mmConfig.server, mmConfig.user, mmConfig.password,
mmConfig.database);
OracleConnection conn = new OracleConnection(connStr);
conn.Open();
(...)
M. LANGE
Original issue reported on code.google.com by [email protected]
on 19 Feb 2008 at 10:09
Attachments:
What steps will reproduce the problem?
1. Generate schema file for information_schema(mysql 5.0) using mysqlmetal
2.
3.
What is the expected output? What do you see instead?
no .cs file output instead a stack trace is visible
What version of the product are you using? On what operating system?
dblinq v0.15, Windows XP sp2, .net 3.5, mysql 5.0
Please provide any additional information below.
MysqlMetal failed:System.Data.SqlTypes.SqlNullValueException: Data is
Null. This method or property cannot be called on Null values.
at MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index,
Boolean checkNull)
at MySql.Data.MySqlClient.MySqlDataReader.GetString(Int32 column)
at SqlMetal.schema.mysql.TableSql.fromRow(MySqlDataReader rdr)
at SqlMetal.schema.mysql.TableSql.getTables(MySqlConnection conn,
String db)
at SqlMetal.schema.mysql.Vendor.LoadSchema()
at SqlMetal.Program.Main(String[] args)
Original issue reported on code.google.com by [email protected]
on 14 Feb 2008 at 11:48
Problem with pqsqlmetal.exe
Postgresql type "time without time zone" is being mapped as
"L52_mapCsType_unprepared_for_postgresqltype_time without time zone" which
is not compiling in the generated .NET class.
Database encoding is 1251.
Original issue reported on code.google.com by [email protected]
on 19 Jan 2008 at 10:21
I am quite happy that this project exist :) !!!
A strange generated code:
[FunctionEx(Name = "pldbg_get_target_info", ProcedureOrFunction = "")]
//public L52_mapCsType_unprepared_for_postgresqltype_targetinfo
pldbg_get_target_info([Parameter(Name = "signature", DbType = "text")]
string signature
// ,[Parameter(Name = "targettype", DbType = "oid")] byte[]
targettype)
//{
// IExecuteResult result = base.ExecuteMethodCall(this,
((MethodInfo)(MethodInfo.GetCurrentMethod())), signature, targettype);
// return
(L52_mapCsType_unprepared_for_postgresqltype_targetinfo)result.ReturnValue;
//}
The c# compiler reports:
Error 1 The type or namespace name
'L52_mapCsType_unprepared_for_postgresqltype_targetinfo' could not be found
(are you missing a using directive or an assembly reference?)
I did comment 10 of these and it worked.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2008 at 10:05
MySqlMetal will create a short for an unsigned MEDIUMINT
mediumint is a 3 byte value. Should either make it an int or create some
new limited value type to properly support it. Or have mysqlmetal
error/warn saying it's not supported.
Original issue reported on code.google.com by [email protected]
on 13 Jun 2007 at 6:35
There is some errors on Oracle DB linq ver 0.14 :
the first and important problem is about generated the primary keys.
If table had more than 1 primary key It doesn’t work correct.
and second problem is about DataField Types that the beter types is here:
public static string mapSqlTypeToCsType(string dbType, decimal? precision)
{
switch(dbType)
{
case “NUMBER”:
return “decimal”;
case “VARCHAR2″:
return “string”;
case “TIMESTAMP”:
return “DateTime”;
case “CHAR”:
return “string”;
case “NVARCHAR2″:
return “string”;
case “DATE”:
return “DateTime”;
case “BLOB”:
return “byte[]”;
case “LONG”:
return “Int64″;
default:
return “UnknownOracleType_20 //(Unprepared for Oracle type “+dbType+”)
\n”;
}
}
Original issue reported on code.google.com by [email protected]
on 30 Jan 2008 at 11:13
What steps will reproduce the problem?
1. Generate cs file using pgsqlmetal for a table with foreign
key references.
What is the expected output?
_toode must be in lower case like:
[Association(Storage="_toode", ThisKey="toode",Name="hetkesei_toode_fkey")]
What do you see instead?
Storage="_Toode" is in upper case:
[Association(Storage="_Toode", ThisKey="toode",Name="hetkesei_toode_fkey")]
Andrus Moor
Original issue reported on code.google.com by [email protected]
on 31 Dec 2007 at 4:12
(see the title :))
Original issue reported on code.google.com by picrap
on 10 Mar 2008 at 8:16
To reproduce, add the following unit test to tests and run it:
#if POSTGRES
public class Northwind1 : Northwind {
public Northwind1(System.Data.IDbConnection connection) : base(connection)
{ }
[System.Data.Linq.Mapping.Table(Name = "Cust1")]
public class Cust1 {
[DbLinq.Linq.Mapping.AutoGenId]
string _customerid;
[System.Data.Linq.Mapping.Column(Storage = "_customerid",
Name = "customerid", IsPrimaryKey = true,
DbType="char(10)",
IsDbGenerated = true,
Expression = "nextval('seq8')")]
public string CustomerId {
get { return _customerid; }
set { _customerid = value; }
}
// Dummy property is required only as workaround over empty insert list bug
// If this bug is fixed this may be removed
string _dummy;
[System.Data.Linq.Mapping.Column(Storage = "_dummy",
DbType = "text", Name = "dummy")]
public string Dummy {
get;
set;
}
}
public DbLinq.Linq.Table<Cust1> Cust1s {
get {
return base.GetTable<Cust1>();
}
}
}
[Test]
public void G11_InsertCharSerialPrimaryKey() {
Northwind dbo = CreateDB();
Northwind1 db = new Northwind1(dbo.DatabaseContext.Connection);
db.ExecuteCommand(@"create sequence seq8;
create temp table cust1 ( CustomerID char(10) DEFAULT nextval('seq8'),
dummy text
);
");
DbLinq.Linq.Table<Northwind1.Cust1> Cust1s =
db.GetTable<Northwind1.Cust1>();
var Cust1 = new Northwind1.Cust1();
Cust1.Dummy = "";
db.Cust1s.Add(Cust1);
db.SubmitChanges();
db.ExecuteCommand("drop table cust1; drop sequence seq8;");
Assert.IsNotNull(Cust1.CustomerId);
}
#endif
Observed:
ArgumentException occurs
in SetField(). This exception is not passed to caller. So insert command
fails without any notice to application code.
Proposed fix attached.
Original issue reported on code.google.com by [email protected]
on 18 Mar 2008 at 7:44
Attachments:
The last missing part: a collision detector in Parent members generator
(which is present in the current implementation)
Original issue reported on code.google.com by picrap
on 10 Mar 2008 at 8:14
What steps will reproduce the problem?
1. Click on the link from http://code2code.net/DB_Linq/index.html
2. Use Tortoise SVN to download code from
tsvn:http://code.google.com/p/dblinq2007/source
What is the expected output? What do you see instead?
I get:
Error: PROPFIND request failed on '/p/dblinq2007/source'
Error: PROPFIND of '/p/dblinq2007/source': 400 Bad Request
(http://code.google.com)
Original issue reported on code.google.com by [email protected]
on 19 Nov 2007 at 5:58
I implemented missing ExecuteQuery.
This patch contains also implementation with uses Marc Gravell
HyperDescriptor. To use it #Define HyperDescriptor and add class from
Codeproject link from source code.
This increases speed about 100x. Hyperdescriptor should also used in all
other places where properties are set to increase reflection speed
significantly.
Pleasde review and commit attached patch.
Andrus.
Original issue reported on code.google.com by [email protected]
on 19 Mar 2008 at 7:11
Attachments:
The class helps generating user friendly names from DbLinq.
At DbLinq level, we need to keep .NET types, not C# variants.
SqlMetal will then make some optimizations for code generation (but not
before).
Original issue reported on code.google.com by picrap
on 10 Mar 2008 at 8:19
One will get all sorts of errors when running the example because of a
missing database.
Patch i attached.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2008 at 1:47
Attachments:
What steps will reproduce the problem?
1. Checkout from the repository
2. Open "DbLinq_SqliteOnly.sln"
What is the expected output? What do you see instead?
I get a complaint about a missing project.
And it is actually missing in the checkout also.
What version of the product are you using? On what operating system?
VS 2008, XP, Rev 135 of the source
Original issue reported on code.google.com by [email protected]
on 17 Jan 2008 at 1:51
It sould be mentioned on the Project Home, that only MySQL5 is supported.
Original issue reported on code.google.com by [email protected]
on 15 Dec 2007 at 7:20
In Sqlite the TINYINT field type maps to System.Byte.
Support for this has been started in Rev 142
Modified : /trunk/DbLinq/util/RowEnumeratorCompiler.cs
Modified : /trunk/DbLinq/vendor/IDataReader2.cs
Please verify that nothing is broken on other databases.
Original issue reported on code.google.com by [email protected]
on 18 Jan 2008 at 1:33
What steps will reproduce the problem?
use a database with a column called "object"
What is the expected output? What do you see instead?
resulting file has to be edited before being compiled
What version of the product are you using? On what operating system?
0.13
Please provide any additional information below.
it's just necessary to add "object" to the csharp types
Original issue reported on code.google.com by ACluk90
on 20 Dec 2007 at 10:54
In Postgresql if your column name is not ONLY lowercase (it is upper case
or mix case) you need to put it in quotes in the query.
I made a quick and unoptimized hack in RowEnumerator.cs, ExecuteSqlCommand
method. The column description is: something that starts with dot, then
everything different than space, comma or new line. Check if my regular
expression is correct.
cmd.CommandText =
System.Text.RegularExpressions.Regex.Replace(cmd.CommandText,
"\\.[^\\s,\\n]*", CapText);
XSqlDataReader _rdr = cmd.ExecuteReader();
rdr2 = new DataReader2(_rdr);
And added this method for the match evaluator:
static string CapText(System.Text.RegularExpressions.Match m)
{
// Get the matched string.
string x = m.ToString();
// If it is NOT lower case
if (x != x.ToLower())
x = ".\"" + x.Substring(1) + "\"";
return x;
}
And it worked! :)
Original issue reported on code.google.com by [email protected]
on 19 Jan 2008 at 11:29
The databinding of a query made with DBLinq works only one way. Added and
deleted records don't get added and deleted to the Database.
Can this be fixed by supporting the IBindingList interface on the Table class?
Original issue reported on code.google.com by [email protected]
on 30 Jan 2008 at 3:25
CodeFile: DbLinq\vendor\Pgsql\VendorPgsql.cs
Method: ProcessPkField
There is an extra "public." attribute before the sequence name that I
removed with the following extra code line:
sequenceName =
System.Text.RegularExpressions.Regex.Replace(sequenceName,"([^\\.]*\\.)","");
The is also a problem with sequences that are upper or mixed case, so I
again added the extra quotes to this existing line:
sbIdentity.Append(";SELECT currval('\""+sequenceName+"\"')");
After these changes, it worked :) I did add an item.
Original issue reported on code.google.com by [email protected]
on 19 Jan 2008 at 4:27
Attachments:
I have difficulty using svn through my company's firewall. Could you
provide some zip files in your downloads of the metal classes such as
OracleMetal? I'd rather not be downloading every class separately using
the svn web interface.
Original issue reported on code.google.com by [email protected]
on 7 Jan 2008 at 4:22
Missing Not Equal SQL implementation in code file: Operator.cs
method: public static string FormatBinaryOperator(ExpressionType nodeType)
Add the following line:
case ExpressionType.NotEqual: return "!=";
Original issue reported on code.google.com by [email protected]
on 19 Jan 2008 at 12:06
The PostgreSQL type "timestamp with time zone" is not recognized by
SQLMetal. Instead the type is
"L52_mapCsType_unprepared_for_postgresqltype_timestamp with time zone".
Why is the type "timestamp with time zone" not included in the switch
statement of the mapSqlTypeToCsType function in the file
\DB_LINQ\trunk\SqlMetal\schema\pgsql\Mappings.cs?
Couldn't it be added just below the line "case "timestamp without time
zone": "?
Original issue reported on code.google.com by [email protected]
on 28 Jan 2008 at 7:15
Missing code for "double precision" in ParseType(string typeStr) in
PgsqlTypeConversions.cs
case "double precision":
return NpgsqlDbType.Double;
case "time without time zone":
return NpgsqlDbType.Timestamp;
Original issue reported on code.google.com by [email protected]
on 19 Jan 2008 at 3:42
... Yes, that's the best part
Original issue reported on code.google.com by picrap
on 10 Mar 2008 at 8:16
What steps will reproduce the problem?
1. Create a table containing integer column:
create table test ( id integer )
2. Generate cs file using pgsqlmetal
Observed:
DbType = "integer(32,0)"
attibute
Expected:
DbType = "integer"
attibute
Andrus Moor
Original issue reported on code.google.com by [email protected]
on 31 Dec 2007 at 4:08
Currently pgsqlmetal adds schema names to every table name like
public.customers
This does not allow to dynamically switch schemas.
npgsql2beta2 has SearchPath conection strings paramter which allows to
switch schemas dynamically. So schema prefixes are not required in most
cases.
pgsqlmetal should have command option to disable adding schemas names to
table names in generated code.
Original issue reported on code.google.com by [email protected]
on 10 Mar 2008 at 4:48
The run_pgMetal.bat file in SqlMetal\bin contains errors:
1. PgsqlMetal.exe needs to be replaced by SqlMetal.exe
2. The commandline option -Provider=PostgreSQL needs to be added.
This also holds true for the other batch files I think
Original issue reported on code.google.com by [email protected]
on 4 Mar 2008 at 12:11
It happens during deleting rows from MySql 5.0.45 and PostgreSql 8.2 server
and DbLinq in version 0.13 and 0.14
in DbLinq,Linq.MTable.cs in line 326 was:
string sql = "DELETE FROM " + tableName + " WHERE " + proj.keyColumnName +
" in (" + sbDeleteIDs + ")";
I changed this line to:
string sql = "DELETE FROM " + tableName + " WHERE " + proj.keyColumnName +
" in ('" + sbDeleteIDs + "')";
and it works in both servers.
Original issue reported on code.google.com by [email protected]
on 12 Jan 2008 at 8:57
...
Original issue reported on code.google.com by picrap
on 23 Feb 2008 at 9:35
What steps will reproduce the problem?
Problem when using pgsqlmetal on a table with manually named primary key
constraint.
When we add a primary key in pgadmin3 which name we set ourselves we have
this problem:
Missing data from 'constraint_column_usage' for foreign key col1_pk
col1_pk is the manually set primary key constraint name.
When we do not set a name and leave pgadmin3 set the name, there is no
problem when using pgsqlmetal.
Original issue reported on code.google.com by [email protected]
on 19 Feb 2008 at 7:54
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.