@@ -56,28 +56,153 @@ cd ~/workspace/sql-paises-estados-cidades/PostgreSQL
5656```
5757winpty docker run -it --rm --net=host -v $PWD:/tmp postgres /bin/bash
5858```
59+
60+ ##### Windows
5961```
60- psql -h localhost -U postgres_user_city cities -f /tmp/pais.sql
62+ docker run -it --rm --net=host -v c:\Users\Lucas\Desktop\Workspace\cities_api-java\sql-paises-estados-cidades\PostgreSQL: /tmp postgres /bin/bash
6163```
6264
6365```
64- psql -h localhost -U postgres_user_city cities -f /tmp/estado.sql
66+ psql -h localhost -U postgres_user_city cities
6567```
6668
6769```
68- psql -h localhost -U postgres_user_city cities -f /tmp/cidade.sql
70+ \d pais;
71+ ```
72+
73+ ```
74+ select * from pais;
75+ ```
76+
77+ ##### List
78+ ```
79+ http://localhost:8080/countries
80+ ```
81+
82+ ##### Pageable - /countries
83+ ```
84+ http://localhost:8080/countries?page=0&size=10&sort=name,asc
85+ ```
86+ ```
87+ http://localhost:8080/countries?page=0&size=10&sort=name,desc
88+ ```
89+ ```
90+ http://localhost:8080/countries?page=0&size=50&sort=id,asc
91+ ```
92+
93+ ##### /countries/id
94+ ```
95+ http://localhost:8080/countries/1
96+ ```
97+ ```
98+ http://localhost:8080/countries/255
6999```
70100
101+ ```
102+ psql -h localhost -U postgres_user_city cities -f /tmp/estado.sql
103+ ```
104+ ```
105+ psql -h localhost -U postgres_user_city cities -f /tmp/cidade.sql
106+ ```
71107```
72108psql -h localhost -U postgres_user_city cities
73109```
74110
111+ ```
112+ \d cidade;
113+ ```
114+ ```
115+ select * from cidade;
116+ ```
117+ ```
118+ select * from estado;
119+ ```
120+ ```
121+ \d estado;
122+ ```
123+ ```
124+ http://localhost:8080/states
125+ ```
126+ ```
127+ \d cidade;
128+ ```
129+ ```
130+ http://localhost:8080/cities
131+ ```
132+
75133```
76134CREATE EXTENSION cube;
77135```
136+ ```
137+ CREATE EXTENSION earthdistance;
138+ ```
139+
140+ ##### Query Earth Distance
141+
142+ ###### Point
143+ ```
144+ select ((select lat_lon from cidade where id = 4929) <@> (select lat_lon from cidade where id=5254)) as distance;
145+ ```
146+ ```
147+ select lat_lon from cidade where id=5254;
148+ ```
149+
150+ ###### Cube
151+ ```
152+ select earth_distance(
153+ ll_to_earth(-21.95840072631836,-47.98820114135742),
154+ ll_to_earth(-22.01740074157715,-47.88600158691406)
155+ ) as distance;
156+ ```
157+
158+ ```
159+ http://localhost:8080/distances/by-points?from=4929&to=5254
160+ ```
161+ ```
162+ http://localhost:8080/distances/by-cube?from=4929&to=5254
163+ ```
164+
165+ ```
166+ heroku create
167+ ```
168+ ```
169+ git remote -v
170+ ```
171+ ```
172+ git push heroku master
173+ ```
174+ ```
175+ heroku addons:create heroku-postgresql
176+ ```
177+
178+ ```
179+ docker run -it --rm --net=host -v c:\Users\Lucas\Desktop\cities_api-java\sql-paises-estados-cidades\PostgreSQL:/tmp postgres /bin/bash
180+ ```
181+
182+ ```
183+ psql -h host -U user database -f /tmp/pais.sql
184+ ```
185+ ```
186+ psql -h host -U user database -f /tmp/estado.sql
187+ ```
188+ ```
189+ psql -h host -U user database -f /tmp/cidade.sql
190+ ```
191+ ```
192+ psql -h host -U user database
193+ ```
78194
195+ ```
196+ CREATE EXTENSION cube;
197+ ```
79198```
80199CREATE EXTENSION earthdistance;
81200```
82201
83- - [ PostgreSQL: earthdistance] ( https://www.postgresql.org/docs/current/earthdistance.html " PostgreSQL: earthdistance ")
202+ ```
203+ heroku logs --tail
204+ ```
205+
206+ ```
207+ git push heroku master
208+ ```
0 commit comments