-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Primary key support for more then one column - i.e. Composite key #134
Comments
As composite key are not supported, I would like to know if there is any work around for it or if there are some best practices to follow in order to handle situations where a composite key appears to be necessary. Source: |
i created a patch |
@softlion - Can I ask where you put the patch - I'd love support for composite primary keys. Thanks, Jon |
ReSharper attributes
...well? |
It’s fixed since 3 years in my rewrite there https://github.com/softlion/SQLite.Net-PCL2 |
Yeah, I`ve seen this, thank you! |
What's fantastic, is that the task is marked as "up for grab". |
Is there any chance to have this feature in the next 2 years? |
Try my fork
Le jeu. 18 août 2022 à 14:39, Florian Fischer ***@***.***> a
écrit :
Is there any chance to have this feature in the next 2 years?
—
Message ID: ***@***.***>
--
Benjamin Mayrargue
Vapolia.fr
+33682227850
vapolia.fr <http://www.vapolia.fr>/
Skype/WhatsApp/Slack/Discord/Zoom/Teams/Meets/...
|
Adding composite key manually seems to work as a workaround for anyone driving here.
With the ChatMessageDb like this:
This was also mentioned in #1101 |
@tentom why do that when a version that does natively support composite primary keys is available ? |
Because it is a quick fix and workaround. But I will take a look at that library as well. |
public class Image
{
[PrimaryKey]
public int ItemId { get; set; }
Get the following error:
SQLite.SQLiteException was unhandled by user code
HResult=-2146233088
Message=table "Image" has more than one primary key
Source=MyPocket
StackTrace:
at SQLite.SQLite3.Prepare2(IntPtr db, String query) in c:\dev\tfs\MyPocket\MyPocket\SQLite.cs:line 2392
at SQLite.SQLiteCommand.Prepare() in c:\dev\tfs\MyPocket\MyPocket\SQLite.cs:line 1699
at SQLite.SQLiteCommand.ExecuteNonQuery() in c:\dev\tfs\MyPocket\MyPocket\SQLite.cs:line 1573
at SQLite.SQLiteConnection.Execute(String query, Object[] args) in c:\dev\tfs\MyPocket\MyPocket\SQLite.cs:line 467
at SQLite.SQLiteConnection.CreateTable(Type ty) in c:\dev\tfs\MyPocket\MyPocket\SQLite.cs:line 318
at SQLite.SQLiteConnection.CreateTableT in c:\dev\tfs\MyPocket\MyPocket\SQLite.cs:line 288
at MyPocket.Data.SQLitePocketRepository..ctor(String dbPath) in c:\dev\tfs\MyPocket\MyPocket\Data\SQLitePocketRepository.cs:line 24
at MyPocket.View.HomePage.d__0.MoveNext() in c:\dev\tfs\MyPocket\MyPocket\View\HomePage.xaml.cs:line 112
InnerException:
The text was updated successfully, but these errors were encountered: