diff --git a/sql/funcs.go b/sql/funcs.go new file mode 100644 index 00000000..369d2acb --- /dev/null +++ b/sql/funcs.go @@ -0,0 +1,173 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sql + +var funcs = map[string]map[int]bool{ + + "abs": { + 1: true, + }, + + "avg": { + 1: true, + }, + + "ceil": { + 1: true, + }, + + "count": { + 1: true, + }, + + "date": { + 0: true, + 1: true, + }, + + "day": { + 0: true, + 1: true, + }, + + "derivative": { + 1: true, + }, + + "difference": { + 1: true, + 2: true, + 3: true, + 4: true, + 5: true, + 6: true, + 7: true, + 8: true, + 9: true, + }, + + "distinct": { + 1: true, + }, + + "floor": { + 1: true, + }, + + "hour": { + 0: true, + 1: true, + }, + + "intersect": { + 1: true, + 2: true, + 3: true, + 4: true, + 5: true, + 6: true, + 7: true, + 8: true, + 9: true, + }, + + "max": { + 1: true, + }, + + "mean": { + 1: true, + }, + + "median": { + 1: true, + }, + + "min": { + 1: true, + }, + + "mins": { + 0: true, + 1: true, + }, + + "mode": { + 1: true, + }, + + "month": { + 0: true, + 1: true, + }, + + "now": { + 0: true, + }, + + "percentile": { + 1: true, + }, + + "round": { + 1: true, + }, + + "stddev": { + 1: true, + }, + + "sum": { + 1: true, + }, + + "table": { + 1: true, + }, + + "thing": { + 2: true, + }, + + "union": { + 1: true, + 2: true, + 3: true, + 4: true, + 5: true, + 6: true, + 7: true, + 8: true, + 9: true, + }, + + "unixtime": { + 0: true, + 1: true, + }, + + "uuid": { + 0: true, + }, + + "variance": { + 1: true, + }, + + "year": { + 0: true, + 1: true, + }, +} diff --git a/sql/funcs/abs.go b/sql/funcs/abs.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/abs.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/avg.go b/sql/funcs/avg.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/avg.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/ceil.go b/sql/funcs/ceil.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/ceil.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/count.go b/sql/funcs/count.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/count.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/date.go b/sql/funcs/date.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/date.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/day.go b/sql/funcs/day.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/day.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/difference.go b/sql/funcs/difference.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/difference.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/distinct.go b/sql/funcs/distinct.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/distinct.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/floor.go b/sql/funcs/floor.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/floor.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/hour.go b/sql/funcs/hour.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/hour.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/intersect.go b/sql/funcs/intersect.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/intersect.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/max.go b/sql/funcs/max.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/max.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/mean.go b/sql/funcs/mean.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/mean.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/median.go b/sql/funcs/median.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/median.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/min.go b/sql/funcs/min.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/min.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/mins.go b/sql/funcs/mins.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/mins.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/mode.go b/sql/funcs/mode.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/mode.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/month.go b/sql/funcs/month.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/month.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/percentile.go b/sql/funcs/percentile.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/percentile.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/round.go b/sql/funcs/round.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/round.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/stddev.go b/sql/funcs/stddev.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/stddev.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/sum.go b/sql/funcs/sum.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/sum.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/union.go b/sql/funcs/union.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/union.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/unixtime.go b/sql/funcs/unixtime.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/unixtime.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/uuid.go b/sql/funcs/uuid.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/uuid.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/variance.go b/sql/funcs/variance.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/variance.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs diff --git a/sql/funcs/year.go b/sql/funcs/year.go deleted file mode 100644 index c5523f80..00000000 --- a/sql/funcs/year.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © 2016 Abcum Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package funcs