Skip to content

Initial Windows support #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/equinox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ jobs:
- uses: equinox-io/setup@master
- run: go test -bench . -json -benchmem -run=XXX ./...

windows:
name: release --platforms windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: '1.14'
- uses: equinox-io/[email protected]
- name: equinox release
env:
EQUINOX_API_TOKEN: ${{ secrets.EQUINOX_API_TOKEN }}
EQUINOX_SIGNING_KEY: ${{ secrets.EQUINOX_SIGNING_KEY }}
run: go run scripts/release.go -draft windows_amd64

macos:
name: release --platforms darwin
runs-on: macos-latest
Expand All @@ -37,7 +53,7 @@ jobs:
linux:
name: release --platforms linux
runs-on: ubuntu-latest
needs: [macos, benchmark]
needs: [macos, windows, benchmark]
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.14
Expand Down
2 changes: 2 additions & 0 deletions internal/engine/postgresql/convert.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !windows

package postgresql

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/engine/postgresql/parse.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !windows

package postgresql

import (
Expand Down
30 changes: 30 additions & 0 deletions internal/engine/postgresql/parse_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// +build windows

package postgresql

import (
"errors"
"io"

"github.com/kyleconroy/sqlc/internal/metadata"
"github.com/kyleconroy/sqlc/internal/sql/ast"
)

func NewParser() *Parser {
return &Parser{}
}

type Parser struct {
}

func (p *Parser) Parse(r io.Reader) ([]ast.Statement, error) {
return nil, errors.New("the PostgreSQL engine does not support Windows")
}

// https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-COMMENTS
func (p *Parser) CommentSyntax() metadata.CommentSyntax {
return metadata.CommentSyntax{
Dash: true,
SlashStar: true,
}
}
2 changes: 2 additions & 0 deletions internal/engine/postgresql/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !windows

package postgresql

import (
Expand Down