activa / iridium Goto Github PK
View Code? Open in Web Editor NEWIridium - Lightweight .NET ORM for mobile, desktop and server applications
License: MIT License
Iridium - Lightweight .NET ORM for mobile, desktop and server applications
License: MIT License
When I execute the code
string connect = "Host = localhost; Persist Security Info = True; Username = user; Password = abcde; Database = DemoDB";`
var dbContext = new PostgresContext(connect);`
I receive the following error messages:
'IridiumApp.exe' (CLR v4.0.30319: DefaultDomain): caricamento di 'C:\WINDOWS\Microsoft.Ne\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll' completato. Caricamento dei simboli ignorato. Il modulo è ottimizzato e l'opzione del debugger 'Solo codice utente' è abilitata.
'IridiumApp.exe' (CLR v4.0.30319: DefaultDomain): caricamento di 'C:\Users\User\source\repos\IridiumTutorial\IridiumApp\bin\Debug\IridiumApp.exe' completato. Simboli caricati.
'IridiumApp.exe' (CLR v4.0.30319: IridiumApp.exe): caricamento di 'C:\Users\User\source\repos\IridiumTutorial\IridiumApp\bin\Debug\Iridium.DB.Postgres.dll' completato. Caricamento dei simboli ignorato. Il modulo è ottimizzato e l'opzione del debugger 'Solo codice utente' è abilitata.
Eccezione non gestita di tipo 'System.IO.FileNotFoundException' in Modulo sconosciuto.
Non è stato possibile caricare il file o l'assembly 'Iridium, Version=2.1.0.30936, Culture=neutral, PublicKeyToken=null' o una delle relative dipendenze. Impossibile trovare il file specificato.
I installed the "iridium" packages via NuGET, you could help me. For the sake of completeness, I also attach my simple project.
Example: For GUID/UUID primary key that are dabatase generated. Or for mysql TIMESTAMP columns.
Also for CALCULATED COLUMNS (SQL Server).
Property must be read only i guess.
Running application in Windows cannot load assembly MySql.Data,
"The assembly manifest definition does not match the reference to the assembly"
'MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'
nuget.org say "The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore."
https://www.nuget.org/packages/mysql.data/6.9.9
The next version for MySql.Data is v6.9.12
thks
I have the following architecture:
I intend to use Iridium as the database provider in the shared project. I added the Iridium
NuGet package to the .Net Standard project and the Xamarin.Android project, and they compiled normally.
After reading the documentation, I added the Iridium.Db.SQLite
package to both projects, and tried to create the context with the following code in the shared .Net Standard project:
public class MyIridiumContext : SqliteContext
{
public MyIridiumContext () : base(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "myIridium.db"))
{
}
public IDataSet<Family> Family { get; set; }
}
Now, when I try to compile, I get the following error in the Xamarin Android project:
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Iridium.DB.Sqlite.Win32, Version=2.2.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Iridium.DB.Sqlite.Win32.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)
I also get a warning about the targeted project:
Package 'iridium.db.sqlite 2.2.1.530' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Does this mean that I have to implement a context in each platform and lose the shared code? Can I create a really cross-platform solution with Iridium?
Is iridium.db.postgres
compatible with MonoAndroid (Xamarin project) ?
I should access the data in a server database "PostgreSQL" from Android (mobile) and Windows (desktop) applications. Is it possible to make this driver compatible with Android, even only for reading and updating data ?
public class DataBaseHelper : SqliteContext
{
private static string path = System.IO.Path.Combine(System.Environment.GetFolderPath(
System.Environment.SpecialFolder.Personal), "Instadl.db");
public DataBaseHelper() : base(path)
{
}
public IDataSet<options> options { get; set; }
public IDataSet<Fallow> fallows { get; set; }
public IDataSet<Post> posts { get; set; }
public IDataSet<InstaUserShort> instaUserShort { get; set; }
private static DataBaseHelper _dataBaseHelper = null;
public new static DataBaseHelper Instance
{
get
{
if (_dataBaseHelper == null)
{
_dataBaseHelper = new DataBaseHelper();
_dataBaseHelper.CreateTable<Fallow>(false, false);
_dataBaseHelper.CreateTable<Post>(false, false);
_dataBaseHelper.CreateTable<options>(false, false);
}
return _dataBaseHelper;
}
}
[Table.Name("Following")]
public class Fallow
{
[Column.PrimaryKey(AutoIncrement = true)]
public long Pk { get; set; }
public string ProfilePicture { get; set; }
public string ProfilePictureId { get; set; }
public string UserName { get; set; }
public string FullName { get; set; }
[Relation.OneToMany]
public IDataSet<Post> Posts;}
I am developing a mobile application using songs, and I am using Iridium for my backend. Until now, everything has been working fine. When a song file is added, it is added to the database and songs are retrieved when the application loads.
I've just added a new property to my Song data model, and now when I try to access the Song table in the database I get the following error:
Iridium.DB.SqliteException: Cannot add a NOT NULL column with default value NULL.
The exception gets thrown by the following line of code:
dbContext.CreateTableAsync().Wait();
Here's what the added property looks like. None of the other properties have the [Column.Null] attribute, but I added it hopping it might fix the problem. Unfortunately it didn't.
[Column.Null]
bool fav = false;
public bool Favourite
{
get { return fav; }
set { SetProperty(ref fav, value); }
}
Here's the end of the stack trace:
System.AggregateException: One or more errors occurred. ---> Iridium.DB.SqliteException: Cannot add a NOT NULL column with default value NULL
at Iridium.DB.SqliteDataProviderCommon.CreateCommand (System.String sql, Iridium.DB.QueryParameterCollection parameters) [0x00040] in <1d2e1856b479450a975af014732165b0>:0
at Iridium.DB.SqliteDataProviderCommon.ExecuteSql (System.String sql, Iridium.DB.QueryParameterCollection parameters) [0x0000c] in <1d2e1856b479450a975af014732165b0>:0
at Iridium.DB.SqliteDialect.CreateOrUpdateTable (Iridium.DB.TableSchema schema, System.Boolean recreateTable, System.Boolean recreateIndexes, Iridium.DB.SqlDataProvider dataProvider) [0x003d4] in <1d2e1856b479450a975af014732165b0>:0
at Iridium.DB.SqlDataProvider.CreateOrUpdateTable (Iridium.DB.TableSchema schema, System.Boolean recreateTable, System.Boolean recreateIndexes) [0x00006] in <796f5c81668c4f5cb3cf3388fc9d6666>:0
at Iridium.DB.StorageContext.CreateTable[T] (System.Boolean recreateTable, System.Boolean recreateIndexes) [0x00011] in <796f5c81668c4f5cb3cf3388fc9d6666>:0
at Iridium.DB.StorageContext+<>c__DisplayClass42_0`1[T].b__0 () [0x00000] in <796f5c81668c4f5cb3cf3388fc9d6666>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.2/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2879
at System.Threading.Tasks.Task.Execute () [0x00010] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.2/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502
--- End of inner exception stack trace ---
Any suggestions? What should I do? Is this a bug in the library?
Excelent Job! I love your software since CoolStorage.
I profiled a linq query that selects an anonymous type, and the select statement has all columns.
I think this will be a good a enhacement.
var query = from x in db.Clients
select new
{
x.ID,
x.Name
};
Clients is a DATASET and Client class has other mapped properties.
Hi,
Is there a best-practice with Iridium for handling RowVersion or Timestamp fields in for e.g. SQL Server.
Thanks
[Table.Name("B")]
public class B
{
[Column.Size(100)]
public string Class { get; set; }
[Relation.OneToOne(LocalKey ="Id", ForeignKey ="Id")]
public Drawing Drawing { get; set; }
}
[Table.Name("A")]
public class A
{
[Column.PrimaryKey(AutoIncrement = false)]
public Guid Id;
[Column.Size(100)]
public string MainNumber;
}
This throws Iridium.DB.SchemaException: 'Could not create relation B.A', they both share the same name and value for the uniqueidentifier (primary key)
What could be the best strategy to derive from IDataSet<T>
an ObservableCollection<T>
to use the binding of data with UI ?
I'm just trying to install 7071 in a project and I've run into this error in NuGet...
Unable to resolve dependency 'System.Data.SqlSClient'. Source(s) used: 'nuget.org', 'Microsoft Visual Studio Offline Packages'.
Notice the "S" in System.Data.SqlSClient.
TIA
I'm thinking of adding a couple of additional attributes to the project.
[Column.DefaultValue(value = "getUTCdate()")], and
[Trim] (Originally available in Vici.CoolStorage)
What are your thoughts on this? Are there any reasons for not doing them?
iridium.db.sqlite
packagepublic static void Main(string[] args)
{
var db = new StorageContext(new SqliteDataProvider("macOS.sqlite"));
}
Unable to load sqlite3.dll from assembly
at Iridium.DB.Sqlite.NativeLibraryLoader.LoadLibrary () [0x0003d] in <1858feac116e4c2abf2d5a11b4deb376>:0
at Iridium.DB.SqliteDataProviderCommon..ctor (Iridium.DB.INativeLibraryLoader loader, System.String fileName, Iridium.DB.SqliteDateFormat dateFormat) [0x0001f] in <1858feac116e4c2abf2d5a11b4deb376>:0
at Iridium.DB.SqliteDataProvider..ctor (System.String fileName, Iridium.DB.SqliteDateFormat dateFormat) [0x00006] in <1858feac116e4c2abf2d5a11b4deb376>:0
at console_Iridium.MainClass.Main (System.String[] args) [0x0000c] in /Volumes/Code/code/Projects/console_Iridium/console_Iridium/Program.cs:58
Currently there's no easy way to use the common "IN" and "BETWEEN" query expressions in Iridium.
Proposed extension methods:
When used in a LINQ query in Iridium, these extension methods are translated to the proper SQL expression. For non-SQL data providers, filtering will be done in code.
I'm trying o get familiar with Iridium and so far I'm liking it.
I'm trying to do basic CRUD but my update statement doesn't seem to work.
using (var db = new DbContext())
{
var template = db.Templates.FirstOrDefault(x => x.Title == item);
template.Title = txtTitle.Text;
template.Text = txtPredefinedMessage.Text;
db.Templates.Update(template);
}
Debugging shows that it gets the template just fine and fields update but the issue is committing the update to the database.
I've also tried with just db.Update(template) and .Save as well - what am I missing?
The [Column.Trim]
attribute, when added to a string property in a mapped class, will trim the value of the property after reading from the database.
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.