View Bean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
ConnectionFactoryInitializer initializer(@Qualifier("connectionFactory") ConnectionFactory connectionFactory) { | |
ConnectionFactoryInitializer initializer = new ConnectionFactoryInitializer(); | |
initializer.setConnectionFactory(connectionFactory); | |
ResourceDatabasePopulator resource = | |
new ResourceDatabasePopulator(new ClassPathResource("schema.sql")); | |
initializer.setDatabasePopulator(resource); | |
return initializer; | |
} |
View schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS member ( | |
id SERIAL PRIMARY KEY, | |
name TEXT NOT NULL | |
); |
View application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.r2dbc.url=r2dbc:postgresql://postgres@localhost:5432/reactive | |
logging.level.org.springframework.r2dbc=DEBUG |
View MemberController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping(value = "/api/member") | |
@RequiredArgsConstructor | |
public class MemberController { | |
private final MemberRepository memberRepository; | |
@GetMapping | |
public Flux<Member> getAll() { | |
return memberRepository.findAll(); |
View MemberRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface MemberRepository extends R2dbcRepository<Member, Long> { | |
Mono<Member> findByName(String name); | |
} |
View ReactivePostgresApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class ReactivePostgresApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(ReactivePostgresApplication.class, args); | |
} | |
} |
View Member.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Value | |
@Builder | |
public class Member { | |
@Id | |
private Long id; | |
private String name; | |
} |
View profiles.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", | |
"profiles": |
View find_and_move.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for /r "C:\Users\KHM\Downloads\" %x in (*.mkv) do move "%x" "C:\Users\KHM\Downloads\familyguy\" |
View How to install NVM on ZSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find the latest version on https://github.com/creationix/nvm#install-script | |
# Install it on bash first | |
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash | |
# Add in your ~/.zshrc the following: | |
export NVM_DIR=~/.nvm | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" |
NewerOlder