Skip to content

Commit f2fb23f

Browse files
authored
Update README.md
1 parent c4c27c0 commit f2fb23f

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,29 @@
99
- arranging data into primitive types, typed active record classes, collections and more
1010
- allowing to run any nonselect queries
1111

12-
Databasic packages:
13-
- Microsoft SQL
14-
- MySql
15-
- PostgreSql
16-
- SQLite
17-
- OracleSql (in progress)
12+
## Features
13+
- choosing connection by config index or name as another param of Databasic.Statement.Prepare()
14+
- passing transactions as second param of Databasic.Statement.Prepare()
15+
- any non-select SQL statements
16+
- Microsoft SQL Server/MySQL/MariaDB/PostgreSQL/Oracle/ODBC/OLEDB support
17+
- selection single value (for example counts etc...)
18+
- getting only touched (changed) values
19+
- saving and deleting active record instances (insert/update/delete by primary key and autoincrement column)
20+
- much more...
1821

1922
## Instalation
2023
**This is core package only**. Install this package only by installing specific database package like: Databasic.<DatabaseType>. Then this package will be installed automaticly with the specific database package.
2124
```nuget
2225
PM> Install-Package Databasic.DatabaseType
2326
```
24-
(database types: MsSql, MySql, PostgreSql, SQLite, OracleSql)
25-
26-
27+
### Databasic packages:
28+
- `Databasic.MsSql`
29+
- `Databasic.MySql`
30+
- `Databasic.PostgreSql`
31+
- `Databasic.OracleSql`
32+
- `Databasic.SQLite`
33+
- `Databasic.OdbcSql`
34+
- `Databasic.OleSql`
2735

2836
## Basic Examples
2937
```vb
@@ -32,6 +40,7 @@ Imports Databasic
3240
' create active record class extending Databasic.ActiveRecord.Entity:
3341
<Connection("ConfigConnectionName")>
3442
Public Class Person
43+
<PrimaryKey, AutoIncrement>
3544
Public Id As Int32?
3645
Public Property Firstname As String
3746
Public Property Secondname As String
@@ -66,6 +75,7 @@ using Databasic;
6675
// create active record class extending Databasic.ActiveRecord.Entity:
6776
[Connection("ConfigConnectionName")]
6877
public class Person {
78+
[PrimaryKey, AutoIncrement]
6979
public int? Id;
7080
public string Firstname { get; set; }
7181
public string Secondname { get; set; }
@@ -102,6 +112,7 @@ using System.Collections.Generic;
102112

103113
[Connection("DefaultConnection"),Table("Dealers")]
104114
class Dealer: Person {
115+
[PrimaryKey, AutoIncrement]
105116
public int? Id { get; set; }
106117
[Column("Firstname"), Trim]
107118
public string FirstName { get; set; }
@@ -121,10 +132,10 @@ class Dealer: Person {
121132
$"SELECT COUNT(Id) FROM {Table()}"
122133
).FetchOne().ToInstance<Int32>();
123134
}
124-
public static Dictionary<object, Dealer> GetDictionary (Func<Dealer, object> keySelector = null) {
135+
public static Dictionary<int, Dealer> GetDictionary (Func<Dealer, int> keySelector = null) {
125136
return Statement.Prepare(
126137
$"SELECT {Columns()} FROM {Table()}"
127-
).FetchAll().ToDictionary<object, Dealer>(
138+
).FetchAll().ToDictionary<int, Dealer>(
128139
keySelector ?? (d => d.Id.Value)
129140
);
130141
}
@@ -135,19 +146,11 @@ class Dealer: Person {
135146
}
136147
}
137148
...
138-
Dictionary<object, Dealer> dct = Dealer.GetDictionary();
149+
Dictionary<int, Dealer> dct = Dealer.GetDictionary();
139150

140151
List<Dealer> list = Dealer.GetList();
141152

142153
Dealer dealer1 = Dealer.GetById(3);
143154

144155
int cnt = Dealer.GetCount();
145156
```
146-
147-
## Features
148-
- choosing connection by config index or name as another param of Databasic.Statement.Prepare()
149-
- passing transactions as second param of Databasic.Statement.Prepare()
150-
- any non-select SQL statements
151-
- Microsoft SQL Server and MySQL server support
152-
- selection single value (for example counts etc...)
153-
- much more

0 commit comments

Comments
 (0)