EntityFrameworkCore.BootKit icon indicating copy to clipboard operation
EntityFrameworkCore.BootKit copied to clipboard

How to select field of type super from redshift ?

Open saharati opened this issue 3 years ago • 0 comments

Hello, I try to select a field of type super from redshift and I get the following error: Unhandled Exception is caught, args: IsTerminating[True] , System.NotSupportedException: The field 'payload' has type 'super', which is currently unknown to Npgsql. You can retrieve it as a string by marking it as unknown, please see the FAQ.

My model:

        [Table("livescore")]
        public class Livescore : IDbRecord
        {
            [Key]
            [Column("message_guid")]
            public string MessageGuid { get; set; }

            [Column("payload")]
            public string Payload { get; set; }
        }

How I try to select it:

            var db = new Database();
            AppDomain.CurrentDomain.SetData("Assemblies", new string[] { "Archive.Tester" });
            
            db.BindDbContext<IDbRecord, DbContext4Redshift>(new DatabaseBind
            {
                MasterConnection = new NpgsqlConnection("Server=host; Port=port;User ID=user;Password=pass;Database=db;Server Compatibility Mode=Redshift")
            });

            var data = db.Table<Livescore>().FirstOrDefault();

Getting the error on the last line, any idea?

saharati avatar Nov 18 '21 17:11 saharati