A set of Groovy scripts for IntelliJ related products to export tables to C# classes for Dapper and TypeScript interfaces. Tested on PostgreSQL and MS SQL on DataGrip and Rider.
Copy the contents of this repository to your scrpts directory - on DataGrip for Windows that's most likely C:\Users_username_.DataGrip2019.2\config\extensions\com.intellij.database\schema
Right click on your table and find the scripts in the "scripted extensions" context menu:
public class User
{
[Key]
public Guid UserId { get; set; }
public Guid RoleId { get; set; }
public string UserLogin { get; set; }
public string PasswordHash { get; set; }
public string EmailAddress { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int? Testnumber { get; set; }
}
export default interface User {
userId: string
roleId: string
userLogin: string
passwordHash: string
emailAddress: string
firstName: string
lastName: string
testnumber?: number
}
You are licensed to do whatever the hell you want with those scripts, though it would be nice if you'd credit me if you use it.