You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am new to RepoDB. Trying it with Postgres. I might be doing something obvious that is wrong as I cannot get it to work. I keep getting this error. Please let me know if there is something I need to try or how to debug this.
RepoDb.Exceptions.MissingFieldsException
There are no database fields found for table 'Account'. Make sure that the target table 'Account' is present in the database and/or at least a single field is available.
[Fact]
public void AccountInsertTest()
{
// Initialize the library for global initialization
var repoDb = new RepoDbRepository<Account>(false);
using var connection = DatabaseFactory.CreateSqlConnection(false);
var id = connection.Insert<Account, long>(
new Account
{
AccountStatus = AccountStatus.Active,
AccountType = AccountType.Admin,
DateCreated = DateTime.UtcNow,
DateUpdated = DateTime.UtcNow
});
id.ShouldNotBe(0);
}
Throws the exception:
Here is the table:
CREATE TABLE account(
id bigserial PRIMARY KEY,
type varchar(36) NOT NULL,
status varchar(36) NOT NULL,
companyname varchar(128),
stripecustomerid varchar(36),
datecreated timestamp NOT NULL,
dateupdated timestamp NOT NULL);
The text was updated successfully, but these errors were encountered:
I'm stuck with this too.. I've never been able to use RepoDB with my database. All my tables have snake_casing so I use Map() but still it doesen't work. It also looks like repodbs table-resolver is case-sensitive I've manage to make thisisatable to work while ThisIsATable does not work.. Map("text") is case-sensitive it seems. And if you are lucky that the table is found then the column/properties are not matched if the column name does not match the property in casing. Doesen't make sense when SQL normally is case-insensitive.. But maybe Postgresql is case-sensitive on this.. I don't know..
@moxplod Try setting Map("account") i believe that Repodb is looking for "Account" not "account" in your db because the c# object has its first letter as uppercase..
Hi, I am new to RepoDB. Trying it with Postgres. I might be doing something obvious that is wrong as I cannot get it to work. I keep getting this error. Please let me know if there is something I need to try or how to debug this.
RepoDb.Exceptions.MissingFieldsException
There are no database fields found for table 'Account'. Make sure that the target table 'Account' is present in the database and/or at least a single field is available.
Here is my setup:
Setup:
Trying this test:
Throws the exception:
Here is the table:
The text was updated successfully, but these errors were encountered: