All Projects → otoolep → go-grpc-pg

otoolep / go-grpc-pg

Licence: MIT License
Simple service exposing a gRPC interface, with a connection to PostgreSQL on the backend

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to go-grpc-pg

Pqstream
pqstream turns your postgres database into an event stream
Stars: ✭ 444 (+1245.45%)
Mutual labels:  postgres, grpc
upper
Upper is a open source back-end framework based on the Dart language.
Stars: ✭ 39 (+18.18%)
Mutual labels:  postgres, grpc
dashboard
Project for managing ML model and deploying ML module. It can deploy the Rekcurd service to Kubernetes cluster.
Stars: ✭ 27 (-18.18%)
Mutual labels:  grpc
vscode-database
Extension for Visual Studio Code
Stars: ✭ 132 (+300%)
Mutual labels:  postgres
nebulo
Instant GraphQL API for PostgreSQL and SQLAlchemy
Stars: ✭ 74 (+124.24%)
Mutual labels:  postgres
go-grpc-bidirectional-streaming-example
gRPC bidirectional streaming example written in golang
Stars: ✭ 83 (+151.52%)
Mutual labels:  grpc
jmeter-grpc-plugin
A JMeter plugin supports load test gRPC
Stars: ✭ 36 (+9.09%)
Mutual labels:  grpc
astro
Astro allows rapid and clean development of {Extract, Load, Transform} workflows using Python and SQL, powered by Apache Airflow.
Stars: ✭ 79 (+139.39%)
Mutual labels:  postgres
fostgres
RESTful APIs for Postgres databases
Stars: ✭ 22 (-33.33%)
Mutual labels:  postgres
exdgraph
gRPC based Elixir Dgraph client. Under development.
Stars: ✭ 112 (+239.39%)
Mutual labels:  grpc
pggen
Generate type-safe Go for any Postgres query. If Postgres can run the query, pggen can generate code for it.
Stars: ✭ 151 (+357.58%)
Mutual labels:  postgres
waypoint-plugin-examples
An example repository that demonstrates how to create and run an external Waypoint plugin
Stars: ✭ 16 (-51.52%)
Mutual labels:  grpc
oesophagus
Enterprise Grade Single-Step Streaming Data Infrastructure Setup. (Under Development)
Stars: ✭ 12 (-63.64%)
Mutual labels:  postgres
akka-persistence-postgres
PostgreSQL plugin for Akka Persistence
Stars: ✭ 57 (+72.73%)
Mutual labels:  postgres
plow
👨‍🌾 Postgres migrations and seeding made easy
Stars: ✭ 13 (-60.61%)
Mutual labels:  postgres
grpc-spring-boot-starter
No description or website provided.
Stars: ✭ 16 (-51.52%)
Mutual labels:  grpc
docker-postgres-windows
No description or website provided.
Stars: ✭ 19 (-42.42%)
Mutual labels:  postgres
vscode-csharp-snippets
Extension of C# Snippets for Visual Studio Code
Stars: ✭ 22 (-33.33%)
Mutual labels:  grpc
go-zipkin-demo
Laravel + go-micro + grpc + Zipkin
Stars: ✭ 65 (+96.97%)
Mutual labels:  grpc
thinkgo
Public libraries and components for glang development.
Stars: ✭ 14 (-57.58%)
Mutual labels:  grpc

go-grpc-pg Circle CI GoDoc Go Report Card

A simple service demonstrating Go, gRPC, and PostgreSQL. Integration with CircleCI (version 1.0) included.

Building go-grpc-pg

Building go-httpd requires Go 1.8 or later. gvm is a great tool for installing and managing your versions of Go.

Download and build it like so:

mkdir go-grpc-pg # Or any directory of your choice
cd go-grpc-pg/
export GOPATH=$PWD
go get -t github.com/otoolep/go-grpc-pg/...
cd src/github.com/otoolep/go-grpc-pg
go install ./...

Some people consider using a distinct GOPATH environment variable for each project doing it wrong. In practise I, and many other Go programmers, find this actually most convenient.

Optional step to speed up testing

Unit testing actually uses SQLite, which is built as part of the test suite -- there is no need to install SQLite separately. However the compilation of SQLite is slow, and quickly becomes tedious if continually repeated. To avoid continual compilation every test run, execute the following command after performing the steps above:

go install github.com/mattn/go-sqlite3

Running go-grpc-pg

Once built as per above, launch the server as follows:

$GOPATH/bin/server

This assumes PostgreSQL is listening on localhost, port 5432. Run $GOPATH/bin/server -h to learn the full configuration the server expects of PostgreSQL, including the database, user, and password that must exist.

Generating queries

Assuming the server is up and running, execute the client as follows.

$GOPATH/bin/client

An example session is shown below.

>> CREATE TABLE bar (id INTEGER NOT NULL PRIMARY KEY, name TEXT)
Last Insert ID: -1, rows affected: 1
>> SELECT * FROM bar
>> INSERT INTO bar(id, name) VALUES(1, 'bob')
Last Insert ID: -1, rows affected: 1
>> INSERT INTO bar(id, name) VALUES(2, 'tom')
Last Insert ID: -1, rows affected: 1
>> SELECT * FROM bar
1       bob
2       tom
>>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].