Tencent / wcdb

WCDB is a cross-platform database framework developed by WeChat.
Other
10.83k stars 1.41k forks source link

isAutoIncrement in WCDB.Swift #772

Open wkmeow opened 4 years ago

wkmeow commented 4 years ago

The language of WCDB

e.g. Objective-C, Swift or Java

Swift

The version of WCDB

e.g. v1.0.5 WCDB.Swift

The platform of WCDB

e.g. iOS, macOS or Android iOS

The installation of WCDB

e.g. Cocoapods, Carthage, Maven, AAR Package or Git clone

Cocoapods

What's the issue?

Post the outputs or screenshots for errors.

Explain what you want by example or code in English.

when I set var isAutoIncrement: Bool { return true } for struct model , and debugPrint the lasetInserRowId is aways Option(0), dose it only support class model?

wkmeow commented 4 years ago

我给结构体Model 设置了自增属性,var isAutoIncrement: Bool { return true },以及var lastInsertedRowID: Int64 = 0,但是打印出来的内容,一直为Option(0),如果不定义后者的话,打印出来的是一串未定义的数字,比如(-9223372036854775808)

Shin1122 commented 3 years ago

我给结构体Model 设置了自增属性,var isAutoIncrement: Bool { return true },以及var lastInsertedRowID: Int64 = 0,但是打印出来的内容,一直为Option(0),如果不定义后者的话,打印出来的是一串未定义的数字,比如(-9223372036854775808)

我刚开了个新项目,也是这问题