Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 16:58
    mikependon commented #663
  • 16:21
    SpaceOgre commented #663
  • 16:21
    SpaceOgre commented #663
  • 15:47
    mikependon commented #663
  • 15:41
    mikependon unassigned #663
  • Dec 04 15:33
    mikependon labeled #662
  • Dec 04 15:33
    mikependon commented #662
  • Dec 04 15:30
    mikependon reopened #662
  • Dec 04 15:29
    mikependon closed #662
  • Dec 04 15:29

    mikependon on master

    #662 Fixes on the F# Immutable … Merge pull request #665 from mi… (compare)

  • Dec 04 15:29
    mikependon closed #665
  • Dec 04 15:28
    mikependon opened #665
  • Dec 04 15:27

    mikependon on repodb-fixes

    #662 Fixes on the F# Immutable … (compare)

  • Dec 04 15:01
    mikependon reopened #662
  • Dec 04 15:01
    mikependon closed #662
  • Dec 04 15:01

    mikependon on master

    #662 Added an Integration Tests… Merge pull request #664 from mi… (compare)

  • Dec 04 15:01
    mikependon closed #664
  • Dec 04 15:00
    mikependon opened #664
  • Dec 04 15:00

    mikependon on repodb-fixes

    #662 Added an Integration Tests… (compare)

  • Dec 04 14:59
    mikependon commented #662
Swoorup Joshi
@Swoorup
Hi @mikependon do you know how RepoDb deals with OOM exceptions?
does it rethrow exceptions if it can’t be handled.
Michael Camara Pendon
@mikependon
@Swoorup - thanks a lot here, it will be a part of the next release. I placed that as For Grabs, hopeful to see some dev from OSS would PR this.
Otherwise, I will do it on my open time - maybe this weekend
Swoorup Joshi
@Swoorup
@mikependon This query is also failing
        conn.Query(where=(fun (e: EventReadEntity) ->
           e.timestamp >= startDate && e.timestamp <= endDate)
           , orderBy=orderByPositionDesc)
System.Exception: DataAccessError
  "Failed to load: Can't write CLR type System.DateTime with handler type TextHandler"
   at Domain.Location.Queries.SuburbDeltaQuery.clo@81-51.Invoke(IEnumerable`1 msgs) in /Users/swoorup.joshi/work/worktree/gp-suburb-api-2/src/Domain.Location.Queries/SuburbDeltaQuery.fs:line 81
   at Domain.Location.Queries.SuburbDeltaQuery.clo@81-53.Invoke(FSharpList`1 arg00) in /Users/swoorup.joshi/work/worktree/gp-suburb-api-2/src/Domain.Location.Queries/SuburbDeltaQuery.fs:line 81
   at FsToolkit.ErrorHandling.Result.fold[a,b,c](FSharpFunc`2 onOk, FSharpFunc`2 onError, FSharpResult`2 r)
   at Domain.Location.Queries.SuburbDeltaQuery.SuburbDeltaQuery.getDeltasBetweenTwoDates(DateTime startDate, DateTime endDate) in /Users/swoorup.joshi/work/worktree/gp-suburb-api-2/src/Domain.Location.Queries/SuburbDeltaQuery.fs:line 80
I understand its not released yet, but would that be fixed by mikependon/RepoDB#619 ?
that timestamp column has the mapping though.
type EventReadEntity =
    { id: Guid
      position: int64
      correlation_id: Guid
      causation_id: Guid
      stream_key: string
      version: int
      name: string
      [<NpgsqlTypeMap(NpgsqlDbType.Jsonb)>]
      payload: string
      [<NpgsqlTypeMap(NpgsqlDbType.Jsonb)>]
      metadata: string
      schema_revision: int
      [<NpgsqlTypeMap(NpgsqlDbType.TimestampTz)>]
      timestamp: DateTime }
Michael Camara Pendon
@mikependon
Swoorup Joshi
@Swoorup
same issue, also with RepoDb.PostgreSql (1.1.1)
Swoorup Joshi
@Swoorup
logged a bug: mikependon/RepoDB#636
Michael Camara Pendon
@mikependon
I am suspecting this is related to DbType, again can I ask you to tell this as a User Story in our Github page?
Btw i logged a bug in the link above
Michael Camara Pendon
@mikependon
Thanks man :)
I will investigate first
Swoorup Joshi
@Swoorup
np
Swoorup Joshi
@Swoorup
@mikependon I’ll see if I can produce a sample project with the issue next week
Michael Camara Pendon
@mikependon
@Swoorup no worries, thanks for your time here :)
Swoorup Joshi
@Swoorup
Btw, did you also see my last comment?
I fixed the issue by not enabling global automatic conversions.
Converter.ConversionType = ConversionType.Automatic
i.e removed that line
Michael Camara Pendon
@mikependon
Yes, I saw this, but never thought that solves it and upon revisiting your comment, you intentionally said that :) - my missed.
Anyway, it should not be a problem, as setting ConversionType to Automatic would somehow expand further the coverage of likelihood to fix any conversion problems. But it seems to be opposite on this case :(
Btw, it might be the setting that we missed in our Integration Tests. I will see and try to test this one later (ASAP) and will get back to you.
Swoorup Joshi
@Swoorup
Np
Michael Camara Pendon
@mikependon

@Swoorup

do you know how RepoDb deals with OOM exceptions? does it rethrow exceptions if it can’t be handled.

You have such question that I had not answered, I had overlooked it. RepoDB does not have any try-catch in the code line, except for DbRepository which is only uses the try-finally to ensure the disposal of connection in an ConnectionPersistency.PerCall situation.

Meaning, it has no any error handling and every error will be bubble up to the consumers. Therefore, all exceptions you will get is raw seen from my chair.

Swoorup Joshi
@Swoorup
Hmm, ah i see
Swoorup Joshi
@Swoorup
nvm though, that time I was investigating a weird bug
it wasn’t an OOM
Michael Camara Pendon
@mikependon
Okay :) - but it is also a good information for the public that any error is bubble up by the library back to the callers. I think, I will put that in the README.
Swoorup Joshi
@Swoorup
thats a good thing. :thumbsup:
Michael Camara Pendon
@mikependon
We are proud that we do not have an error handler and/or try-catch in the code line, no swallowing, no rethrowing, but instead returning the unmodified exceptions. Therefore, it is up for the consumer to handle it seemlessly
Swoorup Joshi
@Swoorup
:clap: Yeah would be good to point that out.
Ah wish it was easy to consume C# code from F#.
Michael Camara Pendon
@mikependon
Nice! :) hope that would materialize
Swoorup Joshi
@Swoorup
@mikependon let me know if you have any issues setting up the project for the date query issue.
Michael Camara Pendon
@mikependon
Thanks, of course. I am just busy for the upcoming Talks this weekend
Swoorup Joshi
@Swoorup
@mikependon any reason why executescalar doesn’t implement caching?
I am currently returning a binary content from postgres using repodb, which invokes a sql function.
Michael Camara Pendon
@mikependon
Initially, we thought caching is not needed on that area. But your scenario seems to be valid at all due its data type. I can enable it for you, would you be able to create a User Story?
I will consider that request now since we also enabled the cahing at the ExecuteQuery. But there is limitation to the ExecuteQueryMultipe. FYI: @Swoorup
Swoorup Joshi
@Swoorup
Sure
Swoorup Joshi
@Swoorup
Michael Camara Pendon
@mikependon
I saw that, thanks! Just leave your code as it is, hopefully we can include that on the next release.
Are you okay within the next 2 weeks from now?
There are bunch of requests and reports recently, I had not look at them all - so I have to buy my own time again. But this weekend, I'll be busy with something.
Swoorup Joshi
@Swoorup
Sure, no rush at all.
The tile server I am developing is internal only tool. There isn’t much requests atm, but queries average around ~900ms. I threw all the usual indexes(spgist) at it, to no success :/
Jordan BELAY
@JB-WALIDOU_gitlab

Good evening,
First of all sorry for my bad English.
I post here hoping someone can help me :).
I am a junior dotnet developer and I recently discovered RepoDb.
I used at first Entity Framework then Dapper.
I mostly use postgresql in my development because I like this sgbd very much.
So I use repodb with the postgres library.
I currently have two problems in a new api:

  • are there data annotations like in Dapper or EF to indicate that the field is managed in a database?
    (To be ignored when inserting and updating).

  • with DateTimeOffset properties and timestamp with timezone columns I get the following error message:
    "Npgsql.PostgresException (0x80004005): 42804: column "created_at" is of type timestamp with time zone but expression is of type text
    at Npgsql.NpgsqlConnector.<>cDisplayClass160_0.<<DoReadMessage>gReadMessageLong|0>d.MoveNext()"
    I tried to settle the prob with these but without success.

              FluentMapper
                  .Entity<User>()
                  .Table("public.user")
                  .Primary(c => c.Id)
                  .Column(c => c.Id, "id")
                  .Column(c => c.Ulid, "ulid")
                  .Column(c => c.Firstname, "firstname")
                  .Column(c => c.Lastname, "lastname")
                  .Column(c => c.CreatedAt, "created_at")
                  .Column(c => c.UpdatedAt, "updated_at")
                  .DbType(c => c.CreatedAt, DbType.DateTimeOffset)
                  .DbType(c => c.UpdatedAt, DbType.DateTimeOffset);
    
              FluentMapper
                  .Type<DateTimeOffset>() // Define which .NET CLR type
                  .DbType(DbType.DateTimeOffset); // Defines the DatabaseType of the .NET CLR type
  • Finally for the db update, I would like to update only the modified properties of the entity. (entity patch request sent from the api controller).
    I think I'll use the cache of the getAll method for example, check the equality of the 2 objects with the Equals and Gethascode methods and then do some reflection to add the modified properties in a field object.
    What do you think about it ? Is there an easier way to do it ?

Thank you in advance for your precious answers.

Jordan