Skip to content

Feature Request: let FsSql know schema #30

@haf

Description

@haf

As a user,
Doing joins,
I may not want to duplicate all DTOs,
But if I don't, I get these exceptions:

Exception: Mono.Data.Sqlite.SqliteException: SQLite error
no such column: r.images
  at Mono.Data.Sqlite.SQLite3.Prepare (Mono.Data.Sqlite.SqliteConnection cnn, System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, UInt32 timeoutMS, System.String& strRemain) [0x0022a] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs:343 
  at Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () [0x00019] in /private/tmp/source-mono-mac-3.12.0-branch-32/bockbuild-mono-3.12.0-branch/profiles/mono-mac-xamarin/build-root/mono-3.12.0/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:230  (00:00:00.1324668)

When r.images is the field that is a 'string list' that I want to join another table into.

The code looks like: select %s, i.path from my_table t join images i on t.id = i.t_id with a Sql.recordFieldsAlias typeof<MyTable> "t")

But MyTable contains a property images which in this case results from the i.path field.

If FsSql kept track on the schemas for the tageted table MyTable, then it would know to exclude images from the list of 'record field aliases'.

Or perhaps I could just give it an 'exclude' list?

Otherwise, do you create duplicate DTOs for just mapping and then mapping code from your 'internal' DTOs to you 'external' DTOs? It seems like such a waste to write all that extra code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions