help
Root Question Message
relation "permissions" does not exist
. I've been skimming the interwebs, but I can't seem to find a solution. It seems like Dapper is not double quoting the tablename, even though the database model is annotated with [Table("Permissions")]
[Table("\"Permissions\"")]
quote_ident = off
1:
Use parameterized queries: Dapper supports the use of named or unnamed parameters in your queries. Using parameters helps to prevent SQL injection attacks and can also improve performance by allowing the database engine to cache the query plan.
2:
Use standard SQL: Dapper supports most standard SQL syntax, so you should try to use standard SQL statements and functions in your queries whenever possible. This will help to ensure that your queries will work with multiple database types.
3:
Use database-agnostic functions: Some functions, such as COUNT(), AVG(), and SUM(), are supported by most database engines. Using these functions can help to make your queries more portable across different database types.
4:
Use database-specific features sparingly: If you need to use a database-specific feature in your query, you should try to isolate it as much as possible to make it easier to port your query to other database types. For example, you can use a case statement or a function to encapsulate the database-specific logic.
quote_ident
setting to the conf file a bit tedious for the users using our tool. Does this mean we should consider using camelCase throughout the tables and fields instead of capitalizing the first letter? Or is there another way?[Column("columnName")]
public string ColumnName { get; set; }
[Table("PERMISSIONS")]
public class Permission
{
[Column("ID")]
public int Id { get; set; }
[Column("NAME")]
public string Name { get; set; }
}
1:
Use a configuration file: You can create a configuration file that users can edit to specify the case sensitivity of their database. For example, you could create an appsettings.json file that contains a setting for the case sensitivity of the database. Users could then edit the file to specify whether the database is case-sensitive or case-insensitive.
2:
Use a command-line argument: You can also allow users to specify the case sensitivity of their database using a command-line argument when starting your tool. For example, you could use the following syntax:
mytool.exe --case-sensitive
3:
Use a configuration API: If your tool is a .NET application, you can also use the .NET Configuration API to allow users to specify the case sensitivity of their database. This API provides a flexible way to read and write configuration data from various sources, such as configuration files, environment variables, and command-line arguments.