Re: [sqlite] how to Add a Table in the existing Sqlite database at client machine
Using Fluent Migrator project you write the following class... [Migration(201101011411)] public class Version_002 : FluentMigrator.Migration { public override void Up() { Create.Column("ColumnName").OnTable("TableName").AsInt32().Nullable(); } public override void Down() { Delete.Column("ColumnName").FromTable("TableName"); } } -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Madhan Kumar Sent: 22 August 2011 13:27 To: sqlite-users@sqlite.org Subject: [sqlite] how to Add a Table in the existing Sqlite database at client machine I, I am using C# windows application(.Net2010) with sqlite, Can you pls let me know, how to add or modify a new column/ table in the existing Sqlite database that is in my client desktop machine. I want the existing database to have its data(not disturbed), and only add a new table/column. Is there any way something like bat file - to execute and update the database file in client machine. or any other way to execute the scripts( like oracle updation of script) Waiting for your reply. Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] how to Add/modify a table in the existing Sqlite database at client side
Take a look at Fluent Migrator project it supports modifying SQLite schema. http://lostechies.com/seanchambers/2011/04/02/fluentmigrator-getting-started/ -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Madhankumar Rajaram Sent: 22 August 2011 12:15 To: sqlite-users@sqlite.org Subject: [sqlite] how to Add/modify a table in the existing Sqlite database at client side Hi, I am using C# windows application(.Net2010) with sqlite, and i need to change the database table. Can you pls let me know, how to add or modify a new column/ table in the existing Sqlite database that is in my client desktop machine. I want the existing database to have its data, and only change the script in order to add a new table/column. Is there any way something like bat file - to execute and update the database file in client machine. or any other way to execute the scripts( like oracle updation of script) Waiting for your reply. Thanks - Madhan This email and any attached files ("Message") may contain confidential and/or privileged information. It is intended solely for the addressee(s). If you receive this Message in error, inform the sender by reply email, delete the Message and destroy any printed copy. Any unauthorized use, distribution, or copying of this Message or any part thereof is prohibited. Emails are susceptible to alteration. Neither Technip nor any of its affiliates shall be liable for the Message if altered or falsified nor shall they be liable for any damage caused by any virus that might be transmitted with this Message. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Field drop work around
I don't think NHibernate would allow me do do that... even if it did it would be difficult to understand. Things are hard enough to understand when I name the fields as per their intention never mind when there would be a level of indirection above it. >Since SQLite is type agnostic why don't you use generic field names? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Field drop work around
Thank you for your response Simon + Teg. The absence of the full ALTER table support turns something that would have been as simple as writing "Delete.Column("ColumnName").FromTable("TableName");" in c# using the fluent migrator project into something that is far from simple and probably quite error prone. I'm sure there are good reasons not to support the full ALTER table syntax but in cases like these it does make life a lot more difficult. Regards, Jack >> Any ideas how I can remove unused fields from the database would be >> appreciated. >Only by doing it manually: ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Field drop work around
Hello all, Is there a workaround for the lack of support for dropping fields? I have an application and need to evolve the database schema as features are added and removed. Leaving fields sitting inside the database that are no longer used will lead to a schema that is difficult to understand. Especially so when the field is marked as NOT NULL. Years from now I will need to supply a value for a field when inserting a row that has long ago ceased to be used. Any ideas how I can remove unused fields from the database would be appreciated. Regards, Jack Hughes ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] System.Data.Sqlite problem
ok Joe that's a relief. Thanks for your help, much appreciated. -Jack -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin Sent: 22 July 2011 16:32 To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] System.Data.Sqlite problem Jack Hughes wrote: > > The 64 bit version works like a charm but the 32 bit version unfortunately does not. The error > message given by test.exe is given at the end of the message. The BadImageFormatException might > suggest a bad download... so I've re-downloaded a number of times and the result with the 32 bit > version is always the same. > This is the expected behavior, let me explain why. First off, I'm going to assume you downloaded the non-mixed-mode packages. They both include a native "SQLite.Interop.dll" (for the appropriate processor architecture) that contains the SQLite core. They also include a pure managed "System.Data.SQLite.dll" (marked as "pure IL" in the CLR header). When any .NET application marked as "pure IL" runs on 64-bit Windows, it will run as a 64-bit process. Similarly, if you run that exact same application on 32-bit Windows, it will run as a 32-bit process. A 64-bit process cannot load a 32-bit DLL. Therefore, the "test.exe" program starts as a 64-bit process and then attempts to load the 32-bit "SQLite.Interop.dll", which raises the BadImageFormatException. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] System.Data.Sqlite problem
Hello, I've just downloaded the 64 bit + 32 bit binary zip versions of System.Data.Sqlite version 1.0.74.0. I unzip and then run the test.exe program. The 64 bit version works like a charm but the 32 bit version unfortunately does not. The error message given by test.exe is given at the end of the message. The BadImageFormatException might suggest a bad download... so I've re-downloaded a number of times and the result with the 32 bit version is always the same. I am running Windows 7 64 bit with VS2010 SP1 installed so all of System.Data.Sqlite's dependencies are installed. Any ideas what's going on? Regards, Jack Hughes See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ** Exception Text ** System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.SQLite.SQLiteFactory' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config(Int32 op, SQLiteLogCallback func, IntPtr pvUser) at System.Data.SQLite.SQLite3.SetLogCallback(SQLiteLogCallback func) in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLite3.cs:line 935 at System.Data.SQLite.SQLiteFactory..cctor() in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteFactory.cs:line 131 --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized) at System.Reflection.RtFieldInfo.InternalGetValue(Object obj, Boolean doVisibilityCheck, Boolean doCheckConsistency) at System.Reflection.RtFieldInfo.GetValue(Object obj) at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) at test.TestCasesDialog.runButton_Click(Object sender, EventArgs e) in c:\dev\sqlite\dotnet\test\TestCasesDialog.cs:line 56 at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.235 (RTMGDR.030319-2300) CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll test Assembly Version: 1.0.0.30023 Win32 Version: 1.0.0.30023 CodeBase: file:///C:/Workspace/SomeProject/2.0/Libs/sqlite-netFx40-binary-Win32-2010-1.0.74.0/test.exe System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.235 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 built by: RTMRel CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.232 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.225 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.225 built by: RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll System.Numerics Assembly Version: