@@ -74,13 +74,13 @@ const secondSchema = {
|
||||
}),
|
||||
};
|
||||
|
||||
const now = DateTime.now().toISO();
|
||||
const now = DateTime.now().toISO()!;
|
||||
const shortlyInTheFuture = DateTime.now()
|
||||
.plus(Duration.fromMillis(555))
|
||||
.toISO();
|
||||
.toISO()!;
|
||||
const farInTheFuture = DateTime.now()
|
||||
.plus(Duration.fromMillis(555666777))
|
||||
.toISO();
|
||||
.toISO()!;
|
||||
|
||||
const facts = [
|
||||
{
|
||||
@@ -127,13 +127,13 @@ const sameFactsDiffDateSchema = {
|
||||
}),
|
||||
};
|
||||
|
||||
const sameFactsDiffDateNow = DateTime.now().toISO();
|
||||
const sameFactsDiffDateNow = DateTime.now().toISO()!;
|
||||
const sameFactsDiffDateNearFuture = DateTime.now()
|
||||
.plus(Duration.fromMillis(555))
|
||||
.toISO();
|
||||
.toISO()!;
|
||||
const sameFactsDiffDateFuture = DateTime.now()
|
||||
.plus(Duration.fromMillis(1000))
|
||||
.toISO();
|
||||
.toISO()!;
|
||||
|
||||
const multipleSameFacts = [
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Knex } from 'knex';
|
||||
import {
|
||||
FactLifecycle,
|
||||
@@ -105,12 +106,13 @@ export class TechInsightsDatabase implements TechInsightsStore {
|
||||
if (facts.length === 0) return;
|
||||
const currentSchema = await this.getLatestSchema(id);
|
||||
const factRows = facts.map(it => {
|
||||
const ts = it.timestamp?.toISO();
|
||||
return {
|
||||
id,
|
||||
version: currentSchema.version,
|
||||
entity: stringifyEntityRef(it.entity),
|
||||
facts: JSON.stringify(it.facts),
|
||||
...(it.timestamp && { timestamp: it.timestamp.toISO() }),
|
||||
...(ts && { timestamp: ts }),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user