<p>SQL domain types like <code>lovelace</code> etc are created in the stage one migration scripts (<code>schema/migration-1*</code> of the repo). Eg <code>lovelace</code> is:</p>
<pre><code>CREATE DOMAIN lovelace AS numeric (20, 0) CHECK (VALUE &gt;= 0 AND VALUE &lt;= 18446744073709551615);
</code></pre>
<p>From these domain types you should be able to figure out the appropriate language type for your language.</p>

CC BY-SA 4.0
2022-06-14T00:15:27.797Z
yes! In the repo - of course it is, thank you!

https://github.com/input-output-hk/cardano-db-sync/blob/acf795fdcb23be0038ffa19554f3c8b0c8c43ed9/schema/migration-1-0001-20190730.sql#L19
RelevantData
CC BY-SA 4.0
2022-06-13T22:07:25.970Z
2022-06-13T22:07:25.970Z
Erik de Castro Lopo
<p>Specifically, I am using the Npgsql lib in a C# console app, and am reading data just fine so far for the obvious types like bigint, uinteger, boolean, etc. - but for a few different types/columns in some tables I am unsure:</p>
<ul>
<li>hash32type</li>
<li>lovelace</li>
<li>word64type</li>
</ul>
<p>Can anyone point me to a resource that would provide me the required knowledge for converting these types into C# types?
Thank you.</p>

<cardano-db-sync><c#>
How to convert some of the db-sync data types/columns to C# data types?
# How to convert some of the db-sync data types/columns to C# data types?

(Asked by: username_0 on 2022-06-13)

Specifically, I am using the Npgsql lib in a C# console app, and am reading data just fine so far for the obvious types like bigint, uinteger, boolean, etc. - but for a few different types/columns in some tables I am unsure:

* hash32type
* lovelace
* word64type

Can anyone point me to a resource that would provide me the required knowledge for converting these types into C# types?
Thank you.

**Tags:** cardano-db-sync, c#

---

## 1 answers

### Answer by username_1 on 2022-06-13. Score: 1 | Accepted answer

SQL domain types like lovelace etc are created in the stage one migration scripts (schema/migration-1* of the repo). Eg lovelace is:
CREATE DOMAIN lovelace AS numeric (20, 0) CHECK (VALUE >= 0 AND VALUE <= 18446744073709551615);

From these domain types you should be able to figure out the appropriate language type for your language.

> **Comments:**
> **username_0**: yes! In the repo - of course it is, thank you!  https://github.com/input-output-hk/cardano-db-sync/blob/acf795fdcb23be0038ffa19554f3c8b0c8c43ed9/schema/migration-1-0001-20190730.sql#L19  

---

