项目作者: yshameer

项目描述 :
REST service to connect to Snowflake DB and do CRUD operations
高级语言: Java
项目地址: git://github.com/yshameer/spring-jpa-snowflake.git
创建时间: 2020-03-10T22:03:29Z
项目社区:https://github.com/yshameer/spring-jpa-snowflake

开源协议:

下载


Spring JPA Snowflake

Before running the project please update the application.properties under src/main/resources with your snowflake connection details

  1. spring.datasource.url=jdbc:snowflake://yourcompany.snowflakecomputing.com/?db=DB_NAME&warehouse=WAREHOUSE_NAME&CLIENT_SESSION_KEEP_ALIVE=true&schema=SCHEMA_NAME
  2. spring.datasource.username=USER_NAME
  3. spring.datasource.password=USER_PWD

In Snowflake create below to test

  1. CREATE TABLE STUDENT (STUDENT_ID NUMBER(4,0), STUDENT_NAME VARCHAR(25), CLASS_ID VARCHAR(10));
  2. INSERT INTO STUDENT VALUES (1, 'RYAN', '6');
  3. INSERT INTO STUDENT VALUES (2, 'MATT', '6');
  4. INSERT INTO STUDENT VALUES (3, 'BILL', '6');
  5. INSERT INTO STUDENT VALUES (4, 'STEVE', '6');

Software required to build and run

  1. Java: JDK 1.8+
  2. Maven: Apache Maven 3.6.3+

Package Information

If you are updating the package, please change the references in

  1. com.github.yshameer.springjpa.snowflake.service.SpringJpaSnowflakeServiceApplication
  2. Line 11: @ComponentScan(basePackages = "com.github.yshameer.springjpa")
  3. com.github.yshameer.springjpa.snowflake.service.configuration.SwaggerDocumentationConfig
  4. Line 30: RequestHandlerSelectors.basePackage("com.github.yshameer.springjpa.snowflake.service.api")
  5. application.properties
  6. spring.jpa.properties.hibernate.dialect=com.github.yshameer.springjpa.snowflake.service.dialect.SnowflakeDialect

Running Locally

To build and run with maven do the following:

  1. mvn clean install
  2. mvn spring-boot:run

Testing Local

  1. http://localhost:8080/student?studentId={studentId}
  2. Swagger UI: http://localhost:8080

Snowflake references

https://docs.snowflake.net/manuals/user-guide-intro.html