DapperLib / DapperLib/Dapper

Dapper custom deserialization / mapping question

Open
#1,010 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

At the moment I am using SQLite. I was taking a look a dapper and was wondering if I could use it to fit my specific use case.

Currently, how I store my date is simple. I do not wish to store every property on my object as a column, but instead store only columns that are important to query on and serialize the object to a BLOB column. for example:

public class User
{
  public int Id { get; set; }
  public DateTime Timestamp { get; set; }
  public string FirstName { get; set; }
  public string LastName { get; set; }
}

Typically, my table would be created with the following query:

CREATE TABLE IF NOT EXISTS Users (Id INTEGER PRIMARY KEY AUTOINCREMENT, Data BLOB);

The Data Column would be the user object serialized. So usually when I query that table I usually manually Deserialize the Data column to return the object.

What I was wondering was, is there a way to inform dapper that when I request a User object from the 'Users' Table to just deserialize the Data Column to return the object?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Review Dapper's mapping and type-conversion entry points for the SQLite Users.Data BLOB scenario; done requires a documented supported approach or a clear statement of the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql, sqlite
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.