Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.5 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.5 KB

IntelliJ POCO Groovy scripts

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.

How to install

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

How to use

Right click on your table and find the scripts in the "scripted extensions" context menu:

image

Example output

Table

image

C#

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; }
}

Typescript

export default interface User {
    userId: string
    roleId: string
    userLogin: string
    passwordHash: string
    emailAddress: string
    firstName: string
    lastName: string
    testnumber?: number
}

License

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.