Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: let FsSql know schema #30

Open
haf opened this issue Feb 26, 2015 · 0 comments
Open

Feature Request: let FsSql know schema #30

haf opened this issue Feb 26, 2015 · 0 comments

Comments

@haf
Copy link
Contributor

haf commented Feb 26, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant