Skip to content

Instantly share code, notes, and snippets.

@moscas
moscas / Avg.groovy
Created December 8, 2020 13:39
Data extractor for IntelliJ which counts the arithmetic mean of the numeric values
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@moscas
moscas / Sum.groovy
Created December 8, 2020 13:38
Data extractor for IntelliJ which counts the sum of numeric values
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@moscas
moscas / generateEntities.groovy
Created February 4, 2019 12:11
generateEntities.groovy
import com.intellij.database.model.DasTable
import com.intellij.database.model.ObjectKind
import com.intellij.database.util.Case
import com.intellij.database.util.DasUtil
/*
* Available context bindings:
* SELECTION Iterable<DasObject>
* PROJECT project
* FILES files helper
@moscas
moscas / CSV-ToOneRow-Groovy.csv.groovy
Last active April 5, 2022 10:43
DataGrip extractors
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where: