Comments (4)
I have added some description to the insert
builder docs that should help to clarify this for others.
Thank you for your feedback. 😊
from sqlhydra.
You have two options when using identity/sequence columns -- you must use either getId
or excludeColumn
in your insert
; otherwise, id
will be included in the insert columns.
- If you want to return the next id sequence, use
getId
.
use ctx = openContext dbConnection
let! nextId =
insert {
for e in myTable do
entity { id = 0; name = "Test" }
getId e.id
}
|> ctx.InsertAsync
- If you don't want to auto query and return the next id sequence, then you must ignore it with
excludeColumn
:
use ctx = openContext dbConnection
let! _ =
insert {
for e in myTable do
entity myRecord
excludeColumn e.id
}
|> ctx.InsertAsync
from sqlhydra.
Great, getId
worked! Would you be able to update the readme so that it says that it is required to use getId
or otherwise it won't work? It doesn't seem to be mandatory if you just follow the docs 😄
Thanks a lot for your help!
from sqlhydra.
Thank you for the lightning speed responses! ❤️
from sqlhydra.
Related Issues (20)
- Reading Option<byte[]> is broken HOT 4
- DateOnly/ TimeOnly Support HOT 12
- Conditional where's, orderBy's, and thenBy's HOT 6
- `where` clause with direct boolean column does not work HOT 4
- Filters for large databases HOT 13
- Missing oracle timestamp datatypes HOT 5
- Feature Request: Upserting multiple records to a single statement HOT 2
- New "Query Logging" feature doesn't capture inserts properly HOT 1
- Some `where` property comparisons do not create a `QueryParameter` HOT 1
- Make a selected column from a leftJoined table option with `Some`
- Support net8.0 HOT 17
- Add documentation and setup configuration on how to clone the repo, build the project, and run tests. HOT 2
- Creating sqlhydra file updates the wrong .fsproj file HOT 9
- SQL Server Temporal Tables Select Issue HOT 8
- Retrieve Multiple result sets (UNION ALL) using SqlHydra.Query HOT 1
- Insert and Update Builders break when column name is the same as another table. HOT 2
- Mapping object with list of objects 1 to n relationship HOT 4
- Best practice for multiple environments and the config.toml file HOT 7
- Design patterns for DDD HOT 8
- Is it possible to support materialized views from Postgres? HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlhydra.