Skip to content

A set of Groovy scripts for DataGrip to export tables to friendly classes

Notifications You must be signed in to change notification settings

mjasikowski/intellij-poco-scripts

Repository files navigation

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.

About

A set of Groovy scripts for DataGrip to export tables to friendly classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages