| Size: 1603 Comment:  |  ← Revision 22 as of 2024-03-14 22:56:11  ⇥ Size: 2255 Comment:  | 
| Deletions are marked like this. | Additions are marked like this. | 
| Line 5: | Line 5: | 
| [[DjangoREST]] also supports sqlite. | [[Python/DjangoREST|DjangoREST]] also supports sqlite. | 
| Line 13: | Line 13: | 
| * apt install sqlite3 * sqlite3 test.db {{{ sqlite> CREATE TABLE IF NOT EXISTS PushNotificationsTable (push text); sqlite> insert into PushNotificationsTable values('aaa'); sqlite> select * from PushNotificationsTable; sqlite> .help sqlite> .databases sqlite> .tables sqlite> .dbinfo sqlite> .output out.txt sqlite> .dump PushNotificationsTable sqlite> .quit | {{{#!highlight sh apt install sqlite3 sqlite3 test.db }}} {{{#!highlight sql -- SQL steps CREATE TABLE IF NOT EXISTS PushNotificationsTable (push text); insert into PushNotificationsTable values('aaa'); select * from PushNotificationsTable; .help .databases .tables .dbinfo .output out.txt .dump PushNotificationsTable .quit | 
| Line 30: | Line 35: | 
| {{{ <dependency> <groupId>com.zsoltfabok</groupId> <artifactId>sqlite-dialect</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <version>3.28.0</version> </dependency> | {{{#!highlight xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <dependencies> <dependency> <groupId>com.zsoltfabok</groupId> <artifactId>sqlite-dialect</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <version>3.45.1.0</version> </dependency> </dependencies> </project> | 
| Line 53: | Line 67: | 
| application.yaml {{{#!highlight yaml spring: datasource: url: jdbc:sqlite:/tmp/test.db driverClassName: org.sqlite.JDBC username: sa password: ???????? jpa: database-platform: org.hibernate.dialect.SQLiteDialect hibernate: ddl-auto: create-drop show-sql: true }}} | 
sqlite
SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. SQLite is the most used database engine in the world.
DjangoREST also supports sqlite.
There is also a JDBC driver for it (Github source code) and it's JPA compliant.
A JDBC sample URL for a DB stored in sample.db file is
jdbc:sqlite:sample.db
Spring notes
pom.xml
   1 <?xml version="1.0" encoding="UTF-8"?>
   2 <project xmlns="http://maven.apache.org/POM/4.0.0" 
   3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
   5 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   6 
   7   <dependencies>
   8     <dependency>
   9       <groupId>com.zsoltfabok</groupId>
  10       <artifactId>sqlite-dialect</artifactId>
  11       <version>1.0</version>
  12     </dependency>
  13     <dependency>
  14       <groupId>org.xerial</groupId>
  15       <artifactId>sqlite-jdbc</artifactId>
  16       <version>3.45.1.0</version>
  17     </dependency>
  18   </dependencies>
  19 </project>
application.properties
spring.datasource.url=jdbc:sqlite:/tmp/test.db spring.datasource.driverClassName=org.sqlite.JDBC spring.datasource.username=sa spring.datasource.password=???????? spring.jpa.database-platform=org.hibernate.dialect.SQLiteDialect spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true
application.yaml
